homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

Float centered a page - now absolute position images is off

5+ Year Member

Msg#: 3376887 posted 5:25 pm on Jun 23, 2007 (gmt 0)

My page started out as left justified with an important image positioned absolute in the upper right corner.
I put the entire page into a div #container box with left/right margins set to auto and text set to "center".
That centered the page.
The next <div> was another container that held the entire page contents with text set to "left".

So the page is centered on screen and everything is normal except the one important image which was positioned "absolute" as a layer.
It, of course, stayed where it was told to.

(Think of a postage stamp on an envelope). The image needs to be in the upper right corner without pushing other images away.
How do I get it to position?
Any pointers?



WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Msg#: 3376887 posted 11:09 pm on Jun 23, 2007 (gmt 0)

Your #container div needs to have
position:relative - then any absolutely positioned elements within this #container will be positioned relative to the #container and not the body, which is what seems to be happening at the moment.

5+ Year Member

Msg#: 3376887 posted 2:34 pm on Jun 24, 2007 (gmt 0)

Thank you so very much!
You're advice was 100 percent accurate.
The page is now centered and the absolute position images align perfectly.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved