Reputation: 1043
I have this issue with <input type="text">
where I see some extra border in top and left of the input box.
I have this CSS code -
#add{
width: 60%;
height: 25px;
margin: 0 auto;
border: auto;
border-radius: 10px;
}
I am attaching the screenshot from chrome. Firefox shows the same thing.
Upvotes: 16
Views: 96983
Reputation: 7
<input type="text" style="border-radius: 25px;" />
100% works
Try this thing
Upvotes: -4
Reputation: 2512
By setting the border: none;
will override/nullify the default input css of the text field and then you can add your own custom css to beautify the input text element like so:
border: none; /*removes the default css*/
border: 1px solid black; /*your custom css*/
border-radius: 10px; /*your-border radius*/
However the above method is unnecessarily tedious whereas you could achieve the same result in just a single line with:
border-radius: 10px !important; /*this simply does the trick!!!*/
**Note:** The !important property in CSS is used to provide more weight (importance)
than normal property. It means that “this is important”, ignore all the subsequent
rules
Upvotes: 0
Reputation: 2585
#add {
width: 60%;
height: 25px;
margin: 0 auto;
border: 1px solid black;
border-radius: 10px;
}
Border auto is doing that for you. So have your own defined border style.
Upvotes: 4
Reputation: 986
I noticed in Chrome that the user agent style that causes this specific look is border-style: inset;
You can see it in the snippet below. Chrome is handy about indicating the user agent styles. I found two ways to fix this appearance.
border: 1px solid black;
and you notice that the border will lose that inset look.border-style: none;
This will cause the border to disappear altogether. You can then set the border as you wish.I would test any of these solutions across different browsers.
Chrome User Agent Stylesheet:
input {
-webkit-appearance: textfield;
background-color: white;
-webkit-rtl-ordering: logical;
cursor: text;
padding: 1px;
border-width: 2px;
border-style: inset; /* This rule adds the inset border */
border-color: initial;
border-image: initial;
}
Upvotes: 1