Jump to content

[SOLVED] Looks great in FF...jacked up in IE. Help?


mazman13

Recommended Posts

if you are putting position: absolute; on a div you have to put position:relative; on the containing div otherwise the absolute doesnt work. I dont know why you have to do this, all i know is that i had this problem when i was learning css and that was the solution i found.

Link to comment
Share on other sites

if you are putting position: absolute; on a div you have to put position:relative; on the containing div otherwise the absolute doesnt work. I dont know why you have to do this, all i know is that i had this problem when i was learning css and that was the solution i found.

 

It is quite simple.

 

A parent containing element using position:absolute ignores any and all html around it. BY DEFAULT it positions itself at the top-left of the browser window. It will not move, stretch wrap, etc in relation to what any other elements within the html markup does. You use "left, right, top, bottom to set the distance from the browser window - so, "left:150px; top:200px" means it positions itself absolutely 150px from the left and 200px from the top of the browser window.

 

Now, position:relative keeps a containing element within the flow of the html - and just like any other container it reacts to all html elements around it within the markup. However, if you place a containing element that has position:absolute within it, it becomes the parent container and the position:absolute container is "relative" to itsparent and NO LONGER to the browser window.

 

So, left, top, bottom and right positioning dimensions also become "relative" to the new parent container and not the browser.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.