Lebada Petru
Lebada Petru

Reputation: 37

How to make only the div color transparent?

Css:

  #container
     {
     position:relative;
     left: 28%;
     width: 50%;
     height: 100%;
     background: black;
     opacity:0.7;
     } 

Html:

 <div id="container">
  Here are texts,images,etc
 </div>

I cant think of a way to make transparent just the div color without affecting the content of #container.Someone know one?

Upvotes: 0

Views: 208

Answers (1)

Vivek Sadh
Vivek Sadh

Reputation: 4268

background-color: rgba(150,150,150,Val between 0 and 1);

RGBA stands for red green blue alpha. The value of alpha is used to determine the intensity of the transparency. 0 being fully transparent and 1 being fully opaque.

FIDDLE DEMO

Upvotes: 1

Related Questions