change button border color when the button is being clicked and after
It might be this, bootstrap has some automatic styling for .navbar-toggle
. You can add something like below to counteract it's default styling.
.navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover{
border:none;
}
.btn.active.focus, .btn.active:focus, .btn.focus, .btn:active.focus, .btn:active:focus, .btn:focus {
outline: 0;
}
Changing border color when button is clicked
That's not a border
but the outline
of the button. You can remove it adding outline: none
to it, but you should consider adding an alternative for those who use the keyboard to navigate.
button{ color: aqua; background-color: transparent; border-radius: 20px; outline: none;}
<button>about</button>
onclick button border color change
The best solution is to use css, try the following code:
.addButton:active,
.addButton:focus
{
border:0.5em solid #00c; /* here configure as your needs */
color:#00c;
}
Hope that helps!
when i clicked on button the border color change default in black color in html and css
It's an on-focus outline, automatically added by your browser. To remove it completely (not advisable), you can add this to your CSS:
button:focus {
outline: none;
}
How to change the border color of a div when clicking a radio button inside the same div?
function colorchange() {
var x = document.getElementById('checker');
var y = document.getElementById('radiobox');
if (x.checked === true) {
y.style.borderColor = "green";
} else {
y.style.borderColor = "silver";
}
}
#radiobox {
width: 300px;
height: 200px;
border: 5px solid;
border-color: silver;
}
<div id="radiobox">
<input type="radio" onclick="colorchange();" id="checker"></input>
</div>
How to change Button border color when clicked in SwiftUI
The solution should look something like this:
@State var selectedButton: Int = 1
var body: some View {
HStack {
Button(action: {
selectedButton = 1
}
, label: {
Text("Option 2")
})
.border(selectedButton == 1 ? Color.red : Color.green, width: 1)
Button(action: {
selectedButton = 2
}
, label: {
Text("Option 2")
})
.border(selectedButton == 2 ? Color.red : Color.green, width: 1)
Button(action: {
selectedButton = 3
}
, label: {
Text("Option 3")
})
.border(selectedButton == 3 ? Color.red : Color.green, width: 1)
}
}
Related Topics
Change a Html5 Input'S Placeholder Color With Css
Is There a CSS Parent Selector
How to Combine a Background-Image and Css3 Gradient on the Same Element
Bootstrap Dropdown Sub Menu Missing
Change Bootstrap Navbar Collapse Breakpoint Without Using Less
Difference Between "Screen" and "Only Screen" in Media Queries
Select Element Based on Multiple Classes
Css3 Gradient Background Set on Body Doesn't Stretch But Instead Repeats
Why Are CSS Named Grid Areas Not in Quotes
Background Color of Text in Svg
Canvas Is Stretched When Using CSS But Normal With "Width"/"Height" Properties
Is There a "Previous Sibling" Selector
In Rc.1 Some Styles Can't Be Added Using Binding Syntax
Select Every Nth Element in Css
Customizing Bootstrap CSS Template
Difference Among Col-Lg-*, Col-Md-* and Col-Sm-* in Bootstrap