Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't border-style: double; render?

Tags:

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?

like image 258
KatieK Avatar asked Feb 08 '13 17:02

KatieK


People also ask

Why is my border style not working?

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.

How do I create a double border in HTML table?

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.

What border style value defines a double border?

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.

How many values can the border style property support?

Syntax. The border-style property may be specified using one, two, three, or four values.


2 Answers

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/

like image 55
MikeSmithDev Avatar answered Oct 01 '22 10:10

MikeSmithDev


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/

like image 21
Musa Avatar answered Oct 01 '22 10:10

Musa