ptamzz
ptamzz

Reputation: 9375

Is there a way to control opacity/transparency of the border color using CSS?

Is there a way to control opacity/transparency of the border color using CSS?

Upvotes: 1

Views: 1695

Answers (2)

reece
reece

Reputation: 8165

Try border: 5px solid rgba(255,0,0,0.5); -- the alpha channel is the last parameter.

NOTE: Not all browsers (read: Internet Explorer) support this.

Upvotes: 0

gblazex
gblazex

Reputation: 50137

You may try rgba color

border-color: rgb(255,255,255); /* fallback for IE */
border-color: rgba(255,255,255, 0.4); /* RGBA for the ones supporting it */

The last one is the (alpha) opacity. But it's not supported in IE, that's why you need a fallback version

Upvotes: 5

Related Questions