Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a borderless textbox in Google Chrome using CSS?

How can I create a borderless HTML textbox to work in Google Chrome browser? I would prefer to do this in CSS, if possible.

like image 203
Sanal MS Avatar asked Jan 27 '11 11:01

Sanal MS


People also ask

How do you make a borderless input in CSS?

If you want a borderless input, add the w3-border-0 class.

How to remove text border in html?

Use the :focus pseudo-class with the "no-outline" class to style the form fields that are focused by the user. To have clear fields in your forms, set the outline property to its "none" value, which is used to display no outline.

How to disable outline in CSS?

We can specify the no border property using CSS border: none, border-width : 0, border : 0 properties.

How to remove outline on focus?

Using the CSS rule :focus { outline: none; } to remove an outline on an object causes the link or control to be focusable, but removes any visible indication of focus for keyboard users. Methods to remove it such as onfocus="blur()" result in keyboard users being unable to interact with the link or control.


2 Answers

CSS 3 might help here:

input[type=text],
input[type=text]:hover,
input[type=text]:focus,
input[type=text]:active
{
    border: 0;
    outline: none;
    outline-offset: 0;
}
like image 56
Skorpioh Avatar answered Nov 14 '22 23:11

Skorpioh


You can use the following to remove the border and the focus outline out of the text boxes.

input[type=text], textarea {
  border: 0;
}

input[type=text]:focus, textarea:focus {
  outline: none;
}
like image 41
Andrew Moore Avatar answered Nov 14 '22 23:11

Andrew Moore