Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a color code for transparent in HTML?

Tags:

html

css

I'm building a new website, and I'm looking for a transparent navigation bar so the background is visible.

like image 980
Emiel.s Avatar asked Aug 12 '13 14:08

Emiel.s


1 Answers

There is not a Transparent color code, but there is an Opacity styling. Check out the documentation about it over at developer.mozilla.org

You will probably want to set the color of the element and then apply the opacity to it.

.transparent-style{      background-color: #ffffff;     opacity: .4;  } 

You can use some online transparancy generatory which will also give you browser specific stylings. e.g. take a look at http://www.css-opacity.pascal-seven.de/

Note though that when you set the transparency of an element, any child element becomes transparent also. So you really need to overlay any other elements.

You may also want to try using an RGBA colour using the Alpha (A) setting to change the opacity. e.g.

.transparent-style{     background-color: rgba(255, 255, 255, .4); } 

Using RGBA over opacity means that your child elements are not transparent.

like image 149
Tim B James Avatar answered Oct 07 '22 16:10

Tim B James