Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent CSS background color

Tags:

html

css

opacity

I want to make the list menu's background disappear by using opacity, without affecting the font. Is it possible with CSS3?

like image 412
Saranya Avatar asked Jun 25 '12 05:06

Saranya


People also ask

How do I make background color transparent in CSS?

To set the opacity of a background, image, text, or other element, you can use the CSS opacity property. Values for this property range from 0 to 1. If you set the property to 0, the styled element will be completely transparent (ie. invisible).

What is the CSS color code for transparent?

There is no hex code for transparency. For CSS, you can use either transparent or rgba(0, 0, 0, 0) .

What is the rgb for transparent color?

rgb(255, 0, 0);opacity:0.8; Notice that the text above will also be transparent/opaque!

How do I change the color of a transparent image in CSS?

The simplest one line that worked for me: filter: opacity(0.5) drop-shadow(0 0 0 blue); You can adjust opacity from 0 to 1 to make color lighter or darker.


2 Answers

now you can use rgba in CSS properties like this:

.class {     background: rgba(0,0,0,0.5); } 

0.5 is the transparency, change the values according to your design.

Live demo http://jsfiddle.net/EeAaB/

more info http://css-tricks.com/rgba-browser-support/

like image 197
Rohit Azad Malik Avatar answered Oct 02 '22 23:10

Rohit Azad Malik


Keep these three options in mind (you want #3):

1) Whole element is transparent:

visibility: hidden; 

2) Whole element is somewhat transparent:

opacity: 0.0 - 1.0; 

3) Just the background of the element is transparent:

background-color: transparent; 
like image 43
jordanb Avatar answered Oct 02 '22 23:10

jordanb