?
Solved

Different Opacity layer, over another opactiy layer

Posted on 2005-04-17
3
Medium Priority
?
1,398 Views
Last Modified: 2007-12-19
Hello,

in a Stylesheet, I have this:

    #bg
    {
        background-color:#ffffff;
        filter:alpha(opacity=40);
        border:#B5A09B 1px solid;
        width:760px;
        height:400px;
        margin:0px;
        text-align:left;
    }

    #content_strip
    {
        background-color:red;
        float:left;
        filter:alpha(opacity=90);
        width:160px;
        height:400px;
        margin:0px;
        text-align:left;
    }


In the index.html page, I'm doing this:

<div id="bg">
    <div id="content_strip">
        ...
    </div>
</div>

Now, I want the layer 'content_strip' to be 90% opacity (as specified in the stylesheet), however, it is automatically adapting the 40% opacity of it's super-layer ('bg').

How can I draw a unique opacity layer on top of another?

Kind Regards;
0
Comment
Question by:InteractiveMind
3 Comments
 
LVL 13

Assisted Solution

by:StormyWaters
StormyWaters earned 400 total points
ID: 13802555
Actually it's becoming 90% of 40%, which is 36%. I personally know of no way to fix this.

Is there a reason for having a transparent "bg" div with just a white background. Why not just leave it solid?
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 800 total points
ID: 13802980
The opacity is cumulative.  At least that is the case when the elements are nested an therefore inherit from the cascade.  

What you could try is taking the nested div out of the parent and then float it on top with absolute positioning and a z-index.  The effect might till be cumulative but it is worth a try.  With these not standard gee whiz things you can never predict how they will turn out anyway.

Cd&
 
0
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 800 total points
ID: 13811348
In IE, the opacity is not inherited by child elements that have "position: relative".
So, adding this rule should solve the problem:

    #content_strip
    {
        position: relative;
    }
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question