I have an h1
on which I've defined the following styles:
h1
{ text-align: center;
border: double black 1px;
padding: 1em;
margin: 1em;
}
Here's a JSfiddle: http://jsfiddle.net/KatieK/Hs3ZQ/
I set the border-style to double, but I'm only seeing a single border rendered. Why isn't a double border rendering?
If you've set the shorthand border property in CSS and the border is not showing, the most likely issue is that you did not define the border style. While the border-width and border-color property values can be omitted, the border-style property must be defined. Otherwise, it will not render.
By setting the border width to 3px with they border style of double, this makes each border 1px plus 1px space between (1+1+1). Basically you should try to set the border width to values divisible by 3. It will automatically try to apply it evenly to both borders and the space between them. Got it.
The following values are allowed: dotted - Defines a dotted border. dashed - Defines a dashed border. solid - Defines a solid border. double - Defines a double border.
Syntax. The border-style property may be specified using one, two, three, or four values.
double
displays two straight lines that add up to the pixel amount defined as border-width (source).
You'll need to use at least 3px.
h1
{ text-align: center;
border: double black 3px;
padding: 1em;
margin: 1em;
}
http://jsfiddle.net/Hs3ZQ/6/
1px is too thin to render a double border, you'll have to make the border thicker.
h1
{ text-align: center;
border: double black 3px;
padding: 1em;
margin: 1em;
}
http://jsfiddle.net/Hs3ZQ/3/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With