Quantcast
Channel: Everyday I'm coding » border
Viewing all articles
Browse latest Browse all 4

How to remove border (outline) around text/input boxes? (Chrome)

$
0
0

Can anyone explain how to remove the orange border (outline) around text/input boxes? I think it only happens on Chrome to show that the input box is active. Here’s the input CSS i’m using:

input {
background-color:transparent;
border: 0px solid;
height:20px;
width:160px;
color:#CCC;
}


Solution:

This border is used to show that the element is focused (i.e. you can type in the input or press the button with Enter). You can remove it, though:

textarea:focus, input:focus{
    outline: none;
}

You may want to add some other way for users to know what element has keyboard focus though for usability.

Chrome will also apply highlighting to other elements such as DIV’s used as modals. To prevent the highlight on those and all other elements as well, you can do:

*:focus {
    outline: none;
}

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images