Is there a way to make the borders of an element semi-transparent? using purely css? like the modal window that facebook uses?
+3
A:
You can use rgba()
such that background-color: rgba(255,0,0,0.5);
is the same as background-color: rgb(255,0,0); opacity: 0.5;
For your border, do something like this border: 3px solid rgba(255,0,0,0.3);
Robert
2010-10-15 20:05:57
how come the corners are darker?
Rana
2010-10-17 01:17:00
Because of the way the browser is rendering the border, it's overlapping on the bottom like that.
Robert
2010-10-17 02:08:01
A:
Well, you can do it in a hackish manner. Here is an article on how to make transparent/semi-transparent borders around a header section:
Michael Goldshteyn
2010-10-15 20:08:20
+1
A:
RGBA is only half of an answer, the other half is background-clip. See there: http://css-tricks.com/transparent-borders-with-background-clip/
Rimantas
2010-10-15 20:14:04
A:
<div id="lightbox">
/* Set transparent background with PNG
add padding to push inside box inward */
<div id="lightbox-inside">
/* Set white background in here */
</div>
</div>
2 divs means proper compadibility. just remember to set your opacity(for ie and all others respectively)
jtmkrueger
2010-10-17 01:05:55