Forum Moderators: not2easy

Message Too Old, No Replies

override opacity on nested div

Trying to figure out how to have a nested div that is fully opaque

         

JCollum

10:49 pm on Sep 12, 2006 (gmt 0)

10+ Year Member



Here's the page:

<body>

This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
This is the text on the body level.<br/>
<div id="divPage" style="filter: alpha(opacity=20); z-index: 100; left: 0px; visibility: visible;
width: 100%; position: absolute; top: 0px; height: 400px; background-color: #ccffff;">
pagesize div
<div id="nestedDiv" style="border-right: #0099cc thin dotted; border-top: #0099cc thin dotted; z-index: 200; left: 136px; border-left: #0099cc thin dotted; width: 250px; border-bottom: #0099cc thin dotted; position: absolute; top: 88px; height: 250px;">
nested div1
</div>

<div id="Div1" style="border-right: #0099cc thin dotted; border-top: #0099cc thin dotted; filter: alpha(opacity=10000); z-index: 300; left: 136px; border-left: #0099cc thin dotted; width: 250px; border-bottom: #0099cc thin dotted; position: relative; top: 88px; height: 250px;">
nested div2
</div>
</div>
</body>

What I'm tring to do is get the opacity of the "nestedDiv" object to be 100%, so that the box is completely opaque. I'm thinking that this isn't possible. I'm shooting for a page with a big partially opaque box over it and a div inside of it that is fully opaque (like a message box). Don't want to resort to Flash for this, because I don't need it that bad. But it seems like it should be possible. And yet...

I tried the technique in this post but it didn't help: [webmasterworld.com ]

Also, the style codes don't seem to work if there's line breaks between the text and first text inside the style tag. FYI.

holyhttp

4:30 am on Sep 13, 2006 (gmt 0)

10+ Year Member



To make "nestedDiv" 100% opaque, just define its background color and that should do it.
To have a consitent layout put the content of each section in its own container. Mixing non contained text and div boxes will just mess up your page layout.

Archer74

6:26 am on Sep 13, 2006 (gmt 0)

10+ Year Member



try:

#nestedDiv{position:relative}

it'll do the same for text/img if you want to have alpha:opacity in a div but not the text/img.

JCollum

7:35 pm on Sep 13, 2006 (gmt 0)

10+ Year Member



Well, neither of those ideas seemed to work in IE. But I got what I wanted by taking nestedDiv out of pageDiv and setting it to a relative position. Apparently nested div's take on the opacity settings of their parents regardless of what you tell it.

JCollum

7:42 pm on Sep 13, 2006 (gmt 0)

10+ Year Member



Also, I was referring to the "[code]" tags for the forum in my first post.