sindrem
sindrem

Reputation: 1231

Button with outline ( Background color ) in bootstrap

I'm using bootstrap to get some design on my website. This button gets an outline in yellow which isnt supposed to be there. If i click anywhere on the page after the pageload, the yellow "border" disappears.

Anyone got a clue what might be wrong? I'm using the class 'btn-warning btn'

enter image description here

Upvotes: 3

Views: 3670

Answers (1)

Pavlo
Pavlo

Reputation: 44965

That golden outline indicates that the button gets focus.That means it will receive input from keyboard (try to press "Enter").

If it happens automatically on page load, it's called "autofocus". To prevent it use autofocus attribute on <body>:

<body autofocus>

If you don't want that golden outline ever appeared (which I would not recommend), disable it with CSS:

.btn:focus { outline: none; }

Upvotes: 7

Related Questions