Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

relative positioning

Status
Not open for further replies.
When positioning an element, you need to specifically state [tt]position: relative;[/tt] only if you want one of the following:
1. position an element according to its previous sibling element (in this case #header, see html code) and shifted for certain value of left/right/top/bottom, or;
2. ensure that elements within this positioned element will have this element as their source (you can check this in Geckos by putting an element somewhere in the page and putting another absolutely positioned element inside this one -- without the positioning, absolutely positioned element will have top left corner somewhere else -- by default the top left corner of the viewport -- and with positioning, top left corner will be in the top left corner of the relatively positioned element)

As for your code, #Content is directly following #Header. Since there is no positioning applied, #Content is positioned statically, following the regular document flow -- and that is under the #Header. #Menu is positioned absolutely to the side of #Content and has nothing to do with the positioning of #Content.

Hope that makes some sense.
 
ok thanks for the help..it makes sense I think. I'll do a bit more digging around the tutorials.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top