Notice the top of the above image. There are three faint borders showing. A 6px semi-transparent “big” border, then a single pixel shadow and single pixel highlight . Normally this technique would just be a sliced image, but I wanted the ability to adjust the theme of the site, and thus the colors of the borders, on the fly in my markup. To do so, I used some simple :before and :after pseudo classes with absolute positioning.
#header {
height: 190px;
background:url(../images/bg-mesh.png) repeat 0 0;
border-top: 6px solid rgba(0,0,0,.1);
}
#header:before {
content: '';
border-bottom: 1px solid rgba(0,0,0,.3);
position: absolute;
left: 0; top: 0;
width: 100%;
margin: 6px 0 0;
}
#header:after {
content: '';
border-bottom: 1px solid rgba(255,255,255,.5);
position: absolute;
left: 0; top: 0;
width: 100%;
margin: 7px 0 0;
}
The advantage to this approach over just using CSS3 box-shadows is that you can set a primary border (the 6px one) to fallback in IE. Because it is the actual border property on the #header element. The less essential ones go away with legacy browsers, which in this case, is perfectly acceptable.