PDA

View Full Version : [CSS] Opacity to Border



Lee
11-01-2013, 07:06 PM
Hi,

is it possible to add transparency to a border without it making the whole div going transparent? It's too create the following effect:

http://i.imgur.com/8Jari.png

(The border isn't a gradient btw just a solid colour with transparency).

All help appreciated and +rep.

Lee!

Calvin
11-01-2013, 07:17 PM
black with 60 opacity: border: 1px rgba(0, 0, 0, 0.6) solid;
white with 30 opacity: border: 1px rgba(255, 255, 255, 0.3) solid;

and use the following if you want curved edges:

-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;

Lee
11-01-2013, 07:25 PM
black with 60 opacity: border: 1px rgba(0, 0, 0, 0.6) solid;
white with 30 opacity: border: 1px rgba(255, 255, 255, 0.3) solid;

and use the following if you want curved edges:

-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;

Hi calvin I'll try that! +REP.

Want to hide these adverts? Register an account for free!