Change Button Border Color When the Button Is Being Clicked and After

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



Leave a reply



Submit