Click to See Complete Forum and Search --> : Need advice on how to make a 2 color double border to a div in css


BWWebDesigns
10-23-2009, 01:40 PM
I have a container div that contains my whole site within it, I have successfully managed to give it a background color and border in css but what I am after is slightly different

I would like the border around the div to be firstly a double line border, I tried using double for the border style etc but not only is each line too thin but they are both the same color

So what I need is to find a way in CSS that I can make a border of a div be a thick double line, one line red one line black

Can anyone point me in the right direction??

Thanks in advance

cfajohnson
10-23-2009, 02:40 PM
Something like http://cfajohnson.com/testing/?

BWWebDesigns
10-23-2009, 02:48 PM
Exactly only with each line a little thicker and closer together if possible??

BWWebDesigns
10-23-2009, 02:49 PM
also this all needs to be done with the style in css for one div tag, cannot have any style for a <p> tag like I noticed in your source

??

cfajohnson
10-23-2009, 03:09 PM
Exactly only with each line a little thicker and closer together if possible??

Adjust the CSS to whatever width you like.


also this all needs to be done with the style in css for one div tag, cannot have any style for a <p> tag like I noticed in your source

??

There is no such capability. See http://www.w3.org/TR/CSS21/box.html#propdef-border-style.

cbVision
10-23-2009, 03:13 PM
You have to wrap the div in another div each with different color borders. Example:

<div style="border: solid 3px #f00;">
<div style="border: solid 2px #000;">
all your content here
</div>
</div>

opifex
10-23-2009, 03:23 PM
If you can't use two elements like nested divs, then you could use CSS3 "border-image:" for one div... but IE doesn't support it (and probably won't any time soon).