Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set transparent background in HTML5 element [duplicate]

Tags:

I want to set the opacity of an element to 0. Now if i do this, all the content of the element will inherit this property. I don't want this, i just want the background to get the opacity 0 while the content (the text for example) stays visible

Any clues ?

Thanks.

like image 710
Debugger Avatar asked Jun 07 '13 20:06

Debugger


People also ask

How do I make a background transparent in html5?

background-color:rgba(55,55,255,0.5); //here i use rgba for color and opacity. for more transparency we can use 0.4 or 0.3,...., box-shadow:2px 2px 2px 2px #999999; }

What is the HTML color code for transparent?

#0000ffff - that is the code that you need for transparent.

How do you change the transparency of the background color in HTML?

Changing the opacity of the background color only To achieve this, use a color value which has an alpha channel—such as rgba. As with opacity , a value of 1 for the alpha channel value makes the color fully opaque. Therefore background-color: rgba(0,0,0,. 5); will set the background color to 50% opacity.

How do I make a div background transparent?

First, we create a <div> element (class="background") with a background image, and a border. Then we create another <div> (class="transbox") inside the first <div>. The <div class="transbox"> have a background color, and a border - the div is transparent.


2 Answers

After some research I found an easy answer - background-color: transparent;

like image 163
Debugger Avatar answered Oct 02 '22 23:10

Debugger


Can you set the background color instead?

background-color: rgba(255,255,255,0.6); 
like image 44
PerkinsB1024 Avatar answered Oct 03 '22 00:10

PerkinsB1024