Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove borders for text input on bootstrap 3

I'm trying to remove top, right and left borders for text input fields, using bootstrap 3. My selector is:

input[type="text"] {
border-top: 0;
border-right: 0;
border-left: 0;

}

It's still showing (in chrome) a slight thin line.

enter image description here

I'm not sure how to get that ghost line to disappear

like image 918
Mike M Avatar asked Jun 03 '16 23:06

Mike M


People also ask

How do I remove the input text border?

Answer: Use CSS outline property This is the default behavior of chrome, however if you don't like it you can easily remove this by setting their outline property to none .

How do I remove the outline of a text box in bootstrap?

In Bootstrap 4, you can add border-0 class to your element to remove its border. Save this answer.

How do I remove a border in bootstrap?

The border-left-0 class is used to remove the left border in Bootstrap 4.

How do I remove the black border from the input field?

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.


3 Answers

You did remove the border from top left and right. That "ghost line" you see, it is the inset shadow. You can remove that as well

input[type="text"] {
     border-top: 0;
     border-right: 0;
     border-left: 0;

     -webkit-box-shadow: none;
     box-shadow: none;
}

and if you want to remove that when a user "focuses" the field

input[type="text"]:focus {
     -webkit-box-shadow: none;
     box-shadow: none;
}
like image 162
tmg Avatar answered Nov 15 '22 04:11

tmg


Write this in your css file.

input {
    border: none;
}

If it is not working please share your html code.

like image 21
Priyank Dey Avatar answered Nov 15 '22 02:11

Priyank Dey


If your form uses tags <fieldset>, try to remove their borders too:

fieldset {  
  border: 0;
}
like image 25
Gleb Kemarsky Avatar answered Nov 15 '22 02:11

Gleb Kemarsky