Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-23-2004, 04:05 PM   PM User | #1
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
IE Blues: Absolute positioning inside relatively-positioned parent isn't working

Oh IE, if only your mother hadn't been experimenting with drugs during your incubation... http://www.offtone.com/v2/

My menu is properly positioned in Gecko, but IE assumes that position: absolute refers to the body element and not the div#header in which #menu resides, which is positioined relatively.

The CSS for my menus positionining:

Code:
#header { position: relative; }
...
#menu {
  position: absolute;
  right: 0;
  bottom: 0;
  list-style-type: none;
  margin-right: 22px;
  margin-bottom: 6px;
}
Thanks for any ideas for getting IE to put my menu where it belongs,
Aaron
__________________
offtone.com | offtonedesign.com
AaronW is offline   Reply With Quote
Old 10-23-2004, 11:30 PM   PM User | #2
mindlessLemming
Senior Coder

 
Join Date: Oct 2003
Location: Australia
Posts: 1,963
Thanks: 0
Thanked 0 Times in 0 Posts
mindlessLemming is an unknown quantity at this point
Mmmm...
Ok, not what you _want_ to do, but it will work...
Absolutely position your header and menu; use body-padding-top to push content clear of the header and the page will continue to flow as normal.
__________________

I take no responsibility for the above nonsense.


Left Justified
mindlessLemming is offline   Reply With Quote
Old 10-24-2004, 12:31 AM   PM User | #3
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
Ah, but if I use that method, any font scaling will screw up the menu. I'm pretty sure I need to use the bottom property.

Either that or I'll have to decide on a new style for the menu
__________________
offtone.com | offtonedesign.com
AaronW is offline   Reply With Quote
Old 10-24-2004, 01:17 AM   PM User | #4
mindlessLemming
Senior Coder

 
Join Date: Oct 2003
Location: Australia
Posts: 1,963
Thanks: 0
Thanked 0 Times in 0 Posts
mindlessLemming is an unknown quantity at this point
Quote:
Originally Posted by AaronW
Ah, but if I use that method, any font scaling will screw up the menu. I'm pretty sure I need to use the bottom property.
Bleh? I think you misunderstood me...
Leave the menu positioning exactly how it is. Apply position:absolute; to the header div so that it's child elements won't bug out when ab.pos.
Now the menu and header should be right, but the content will start up underneath them. Add up the height of the header + its top and bottom margins and set this value as 'padding-top' on the body or containing div, depending on what method you're using. This will push the content clear of the header and the page will look and function the same as it does now.
Here's the code changes you would make:
Code:
#header {
  position: absolute;
  top:15px;
}
and then add
Code:
padding-top:95px;
to the body CSS.

There's always more than one way to skin a cat
__________________

I take no responsibility for the above nonsense.


Left Justified
mindlessLemming is offline   Reply With Quote
Old 10-24-2004, 02:06 AM   PM User | #5
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
Oh right. I guess IE doesn't break when the parent is absolutely positioned. That's the bit I needed to know :P

Thanks.
__________________
offtone.com | offtonedesign.com
AaronW is offline   Reply With Quote
Old 10-24-2004, 02:09 AM   PM User | #6
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
Ah, super. Worked a charm. Guess I'll have to start thinking even futher out of the box... Yeesh.
__________________
offtone.com | offtonedesign.com
AaronW is offline   Reply With Quote
Old 10-24-2004, 11:54 PM   PM User | #7
mindlessLemming
Senior Coder

 
Join Date: Oct 2003
Location: Australia
Posts: 1,963
Thanks: 0
Thanked 0 Times in 0 Posts
mindlessLemming is an unknown quantity at this point
Of course it worked
(I checked first!)
__________________

I take no responsibility for the above nonsense.


Left Justified
mindlessLemming is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:59 AM.


Advertisement
Log in to turn off these ads.