Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Double Border with outer border thicker than inner border

Tags:

css

In my current work I'm required to produce a double border on a container. The border-style: double; achieve this, however my client want the outer border to be thicker & the inner border to be of the normal thickness.

Other than creating 2 divs, 1 nested inside another with the outer div having a larger thickness, or through the use of border images is there any way I can do it with CSS with just 1 div? specifying border-style: double; and still be able to make the outer border thicker.

like image 397
learnjourney Avatar asked Nov 15 '10 03:11

learnjourney


People also ask

Which CSS property affects the thickness of the border?

The border-width shorthand CSS property sets the width of an element's border.

Can you have 2 borders CSS?

Multiple borders in CSS can be done by box-shadow property. Generally, we can get a single border with border property. Box-shadow property is not for multiple borders, but still, we are creating multiple borders with box-shadow property.

How would you change the border thickness using?

Select one or more cells that have a border that you want to change. Right-click over the cells you've chosen and select Format Cells and, in the popup window, click the Border tab. For a continuous line, choose one of the thicker styles from the Line box. In the Presets section, click your existing border type.

How do you avoid double border in CSS?

Add a border-left and border-top to the parent. Add border-right and border-bottom to each of the children.


1 Answers

Outlines are included in the CSS3 specification and allow both a border and an outline to be applied to a single element.

The outline property is identical to the border command. The additional offset property however allows the border to be moved further inside or outside of the element.

I used outlines to give borders 2 different colors, change the code to give your borders 2 different sizes.

#box { border: 1px double #000; outline: 2px solid #699; outline-offset: -9px; }
like image 107
bnabilos Avatar answered Nov 04 '22 07:11

bnabilos