6

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> 
0

2 Answers 2

10

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

Sample Demo

Sign up to request clarification or add additional context in comments.

4 Comments

yes thanks it's working. but is it works in all the browser?
@user3197474 : i think ie does not supports...
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/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.