George Irimiciuc
George Irimiciuc

Reputation: 4633

Input default CSS

http://jsfiddle.net/fj5u5Lk3/

<input type="text"></input>

On focus, this field gets a blue border, by default. Where can I find the default value and color code of it? I want to add my own, but it gets overwritten. I want to remove it, but then want to add it back on, and can't without knowing the default values.

Upvotes: 4

Views: 11638

Answers (3)

Ihsan Praditya
Ihsan Praditya

Reputation: 71

from W3Schools :

Focused Inputs

By default, some browsers will add a blue outline around the input when it gets focus (clicked on). You can remove this behavior by adding outline: none; to the input.

Upvotes: 0

Alex Char
Alex Char

Reputation: 33218

You can use input[type="text"]:focus:

input[type="text"]:focus {
    outline: none;
    box-shadow: 0px 0px 5px #61C5FA;
    border:1px solid #5AB0DB;
}
input[type="text"]:focus:hover {
    outline: none;
    box-shadow: 0px 0px 5px #61C5FA;
    border:1px solid #5AB0DB;
    border-radius:0;
}
<input type="text"></input>

Upvotes: 5

lenden
lenden

Reputation: 830

It's called outline property. You can set

outline: 0px;

to disable it. And, for example

p {
    outline-style: dotted;
    outline-color: #00ff00;
}

for some properties. You can read something here: http://www.w3schools.com/cssref/pr_outline-color.asp or just search "outline css property"

Upvotes: 1

Related Questions