Reputation: 23
I was wondering what you guys think is the easiest way to get a double border with 2 colors around a div? I tried using border and outline together and it worked in Firefox, but outline doesn't seem to work in IE and that's sort of a problem. Any good ways to go about this?
This is what I had but outline does not work with IE:
outline: 2px solid #36F;
border: 2px solid #390;
Upvotes: 1
Views: 280
Reputation: 105853
A few possibilities:
... Left? if you want less than IE8 : wrap 2 elements to draw 2 basic borders
Upvotes: 0
Reputation: 2236
Just use 2 divs
<div style="border: 2px solid #36F">
<div style="border: 2px solid #390">
Text goes here
</div>
</div>
Upvotes: 4
Reputation: 18675
This may work:
.border
{
border:2px solid #36F;
position:relative;
z-index:10
}
.border:before
{
content:"";
display:block;
position:absolute;
z-index:-1;
top:2px;
left:2px;
right:2px;
bottom:2px;
border:2px solid #36F
}
Upvotes: 0