How to set the opacity of the border?
I want it to be transparent so that objects behind the border will be seen.
Try this,
border-color: rgba(0,0,0,0.5); // 50% opacity
The last value varies from 0 to 1. Where 0 is completely transparent and 1 is Opaque.
I think something like this should do the trick:
border: 10px solid rgba(255, 255, 255, 0.5);
More info: http://www.css3.info/preview/rgba/
Choose any CSS colour function with an alpha channel:
rgba(RR, GG, BB, ALPHA)
or hsla(HUE, SAT, LUM, ALPHA)
The alpha value is between 0
and 1
.
You may also want to have a look into background-clip
property for defining the position of the background in relation to the box-model of the element.