Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the blue highlight of a button once pressed when u remove original border?

Tags:

html

css

I don't want the blue border when you click on a button that doesn't have its original border, here is the HTML:

<div id="buttonholder" style="border 1px solid black">
    <button id="previous">&lt; Previous round</button>
    <button id="next">Next round &gt;</button>
    <button id="current">&gt; Current round&lt;</button>

    <div style="font-size: 0;">
        <form id="inputfield" name="inputfield">
            <input type="inputfield" value="Search for round here...">
            <input type="button" value="Go">
        </form>
    </div>

    <div id="displayround">
        1/38
    </div></button>
</div>

If I need to post the entire CSS let me know, just added it in the html to make it short.

like image 964
Duplo W Avatar asked Feb 09 '14 14:02

Duplo W


2 Answers

Its caused by most browsers default styling of the outline property on the :active state

button:active, input[type="button"]:active {
    outline: none;
}
like image 156
DMTintner Avatar answered Nov 14 '22 10:11

DMTintner


In Chrome at least, the blue border is a result of the focus pseudo-class, not active.

Set outline: none in that selector and it will go away:

button:focus, input[type="button"]:focus {
    outline: none;
}
like image 45
BradleyDotNET Avatar answered Nov 14 '22 11:11

BradleyDotNET