/    Sign up×
Community /Pin to ProfileBookmark

Removing CSS opacity styles from inner divs

I have created a background image(backgroundImage) using a div with an opacity. The backgroundImage div goes in the allservices div which too is done. put simply within the allservices container there is a background image, however, within the allservices div there are four sub categories(resid, commoff, stud, and colldeliv) which I don’t want any opacity in. Are there any ways of removing the opacity effect from these sub categories. The only way i can think of think at the moment is using jquery’s remove class. I know this can be done when using images, you just assign the image an id but how does this operate with divs and can be done?
Markup follows below:
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title></title>

<style type=”text/css”>

html, body{margin:0; padding:0;}
#contentcontainer{margin:0 auto; margin-top:15px; height:936px; width:915px;}
#servicescontainer{margin-top:5px; margin-left:15px; height:926px; width:885px;}
#allservices{margin-top:3px; margin-left:10px; height:920px; width:865px;}
div#backgroundImage{margin-top:2.5px; background-image:url(somepicture.jpg); height:915px; width:865px; opacity:0.75; filter:alpha(opacity=75);}
#resid{margin:0 5px 0 5px; margin-top:2.5px; height:247px; width:855px;}
#commoff{margin:0 5px 0 5px; margin-top:5px; height:273px; width:855px;}
#stud{margin:0 5px 0 5px; margin-top:5px; height:180px; width:855px;}
#colldeliv{margin:0 5px 0 5px; margin-top:5px; height:200px; width:855px;}
#infobox{margin-left:22px; padding-top:20px; height:100px; width:865px;}
p.sub-title{font-family:”Lucida Calligraphy”,Times,serif; font-style:italic; font-size:16px;}
p.contenttext{padding-left:5.5px; padding-right:5.5px; font-family:Arial,Helvetica,sans-serif; font-size:13px;}

</style>

</head>
<body>

<div id=”contentcontainer”>
<div id=”servicescontainer”>
<div id=”allservices”>
<div id=”backgroundImage”>

<div id=”resid”>
<center><p class=”sub-title”>this div’s title</p></center>
<p class=”contenttext”>
Some random text for this div
</p>
</div>

<div id=”commoff”>
<center><p class=”sub-title”>this div’s title</p></center>
<p class=”contenttext”>
Some random text for this div
</p>
</div>

<div id=”stud”>
<center><p class=”sub-title”>this div’s title</p></center>
<p class=”contenttext”>
Some random text for this div
</p>
</div>

<div id=”colldeliv”>
<center><p class=”sub-title”>this div’s title</p></center>
<p class=”contenttext”>
Some random text for this div
</div>

</div> /*Closing div for the backgroundImage*/

</div> /*Closing div for the allservices*/
</div> /*Closing div for the servicescontainer*/
</div> /*Closing div for the contentcontainer*/
</body>
</html>

also within the CSS style the following are underlined in red: background-image:url(somepicture.jpg), opacity, and 75. onmouseover dreamweaver says Error parsing style[Microsoft Internet Explorer 5.0], by my understanding this means those styles are not compatible with IE5. Are there any ways around this?

Any idea, solutions, tips, and point outs of errors are much appreciated

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@TheAliveWinnerFeb 27.2012 — [COLOR="Red"]Incorrect use![/COLOR]
[code=html]div#backgroundImage{
margin-top:2.5px;
background-image:url(somepicture.jpg);
height:915px;
width:865px;
opacity:0.75;

filter:alpha(opacity=75); /* this is wrong use */

}[/code]

[COLOR="Green"]Correct use:[/COLOR]
[code=html]div#backgroundImage{
margin-top:2.5px;
background-image:url(somepicture.jpg);
height:915px;
width:865px;
opacity:0.75;

filter: progid:DXImageTransform.Microsoft.Alpha(opacity=75); /* this is correct use */

}[/code]
Copy linkTweet thisAlerts:
@TheAliveWinnerFeb 27.2012 — [B][I][COLOR="DarkSlateGray"]I will try to solve the problem![/COLOR][/I][/B]

?
Copy linkTweet thisAlerts:
@BIOSTALLFeb 28.2012 — Hi nsath,

I experienced the same thing before and wrote about it on my blog. Sounds like it could be similar. You can find the solution here:

http://biostall.com/only-applying-a-css-opacity-to-the-parent-container

Hope that helps ? Cheers
Copy linkTweet thisAlerts:
@nsathauthorFeb 29.2012 — I have already tried this before (mark up not posted here) with no prevail, I have also looked at your blog and found the following difference what you in your blog have set as div class - content, in my case what is allservices is split into four seperate div id's - resid, commoff, stud, and colldeliv. Reason for this is that each div is four a seperate category. I have even tried using the css property z-index but again nothing.

Cheers
Copy linkTweet thisAlerts:
@nsathauthorFeb 29.2012 — BIOSTALL I just double checked over what I had done before and found out that the position property of the div class - sub-title and contenttext were not set to absolute and the div class property of the allservices div was not set at all. Anyhow, Cheers for that much appreciated
×

Success!

Help @nsath spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...