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 03-14-2005, 04:48 PM   PM User | #1
Roy Gardiner
New Coder

 
Join Date: Jan 2004
Location: London, England
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Roy Gardiner is an unknown quantity at this point
position: absolute; not working as I expect (IE6)

It looks to me as if specifying position: absolute; positions the element relative to the start of the document, not to the start of the containing block as my book says.

What am I missing here?
Roy Gardiner is offline   Reply With Quote
Old 03-14-2005, 05:49 PM   PM User | #2
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
You're missing the definition of "Containing Block". Containing block is not the same as parent. The containing block is the closest positioned ancestor. (I.e. the closest ancestor that has it's position property set to a value other than static.)

The fix for your problem is to add position: relative; to the element you want the absolutely positioned element to be relative to.
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline   Reply With Quote
Old 03-14-2005, 06:40 PM   PM User | #3
Roy Gardiner
New Coder

 
Join Date: Jan 2004
Location: London, England
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Roy Gardiner is an unknown quantity at this point
Quote:
Originally Posted by liorean
You're missing the definition of "Containing Block". Containing block is not the same as parent. The containing block is the closest positioned ancestor. (I.e. the closest ancestor that has it's position property set to a value other than static.)

The fix for your problem is to add position: relative; to the element you want the absolutely positioned element to be relative to.
Hah, my understanding is way more broken than I thought but thank you, this should fix me up.
Roy Gardiner 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 07:55 AM.


Advertisement
Log in to turn off these ads.