5

I want to use opacity only for div not on the text. i use some code for div opacity but it show me text opacity also. i do not want to show the text opacity. my code is here.

.opabenner {
width:569px;
height:100px;
float:left;
position:absolute;
background:#06F;
top:587px;
filter:alpha(opacity=60); /* IE */
   -moz-opacity:0.6; /* Mozilla */
   opacity: 0.6; /* CSS3 */
z-index:9999;
  }
 .tit {
position: absolute;
font-size: 20px;
color: #FFF;
text-align: center;
padding: 5px;
width: 580px;
  }


  <div class="opabenner"> 
         <h1 class="tit">Step inside love in 2014 and join today for FREE!</h1>
    </div>
8bitcat
  • 2,206
  • 5
  • 30
  • 59
Rubel Amin
  • 67
  • 1
  • 2
  • 6

2 Answers2

9

use background: rgba(0,0,0,.5); remove opacity: 0.6;

Sample Demo

Karuppiah RK
  • 3,894
  • 9
  • 40
  • 80
0

Use RGBA colors for the container

p{
    color: red;
}

#transparent{
    background-color: rgba(0, 0, 0, .1); /* 0.1 alpha = 10% opacity */
}

Preview: http://jsfiddle.net/EfDZC/

Nabil Kadimi
  • 10,078
  • 2
  • 51
  • 58