Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i set div opacity only not text? [duplicate]

Tags:

html

css

opacity

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>
like image 531
Rubel Amin Avatar asked Feb 13 '23 23:02

Rubel Amin


1 Answers

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

Sample Demo

like image 162
Karuppiah RK Avatar answered Feb 23 '23 10:02

Karuppiah RK