Previous Message
Next Message

Child Seletors, Absolute Positioning, Internet Explorer

Sent by Rich Points on 31 July 2005 05:05


Thanks Jim,
Your solution didn't work because of my absolutely positioned  header.  
When I tried class="hideit" it hid the banner as you would expect but 
leaves an unwanted 140px gap at the top of the page.  This is why I'm 
using the child selectors so I can 1) hide or show the banner and 2) 
position the elements accordingly.  It would be easy if I was using 
relatively positioned elements :-(

Here are my CSS styles again with comments

/* the following is the default state and is defined in the html as <body>*/
#banner_top_container{
    display: none;
}
/*This rule pushes container down to make room for the banner, defined 
in the html as <body id="banner_top">*/
#banner_top>#container{
    margin: 140px auto 0 auto;
}
/*the following pushes down the header 150px to make room for the 
banner; <body id="banner_top">*/
#banner_top>#container>#header{
    top: 150px !important;
}
/*This rule renders the banner and positions it relative to the 
absolutely positioned #header.  <body id="banner_top">*/
#banner_top>#container>#header>#banner_top_container{
    display: block !important;
    margin: -175px auto 0px 80px;
    padding: 35px 0 0 0;
}

I have this working in FireFox but the trick is to get it working IE.

I'm not using the same urls from my last post here are my updated pages

This one has the banner off <body>
http://gatewaygourmet.com/Test/index.htm

Thia one has the banner on <body id="banner_top">
http://gatewaygourmet.com/Test/seafood.htm

Thanks
Rich


Jim Davis wrote:

>Rich,
>
>I had success with:
>
>.hideit { display: none } [added to the css]
>
>On pages where a banner is not shown use:
><div id="banner" class="hideit">banner image goes here</div>
>
>I did a little demo at: http://www.jimdavis.org/test/banner_on.htm.
>Click "turn banner off" to switch states.
>hth
>Jim
>
>On 7/30/05, Rich Points [EMAIL-REMOVED]> wrote:
>  
>
>>CSS Gurus,
>>  ..........The client would like to have the option to put a banner/advertisement above
>>the content section or to have no advertisement. ....
>>
>>Here is a page that uses a banner
>>http://gatewaygourmet.com/Test/seafood.shtml
>>
>>and a page without a banner
>>http://gatewaygourmet.com/Test/index.shtml
>>
>>What's needed to make this work in Internet Explorer 6?
>>    
>>
>______________________________________________________________________
>css-discuss [EMAIL-REMOVED]]
>http://www.css-discuss.org/mailman/listinfo/css-d
>List wiki/FAQ -- http://css-discuss.incutio.com/
>Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>
>  
>
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: