Forum Moderators: not2easy

Message Too Old, No Replies

top margin disappears on internal page link

when click # to id, margins go away

         

phazei

7:35 am on Jun 25, 2008 (gmt 0)

10+ Year Member



Is there any particular reason why
page.php would work but page.php#link would remove upper margins?

I have a container div, a left div (absolute), a right div (absolute), a center div(relative).
There is a sub-container in the center div.

When a internal link is clicked, the spacing between the container and the center div goes away.

I tried between padding on the container div, margin-top on the center div, top on the center div, and margin-top on sub-container div, top on the sub-container div.

No matter which way I do it, the spacing goes away once the internal link is clicked.

In IE6 if I click the link then refresh (f5) it fixes it self. If I click the addy bar with the # link there and press enter, problem reoccurs.

When I had the spacing on the container div, the top content in the right div got cut off on the top.

I'm utterly baffled.

I'm using IE6 and FF3. Behavior same in most cases.

phazei

8:18 am on Jun 25, 2008 (gmt 0)

10+ Year Member



Oh, just noticed, about the content on the right div being cut off. If I set the center div to overflow:hidden, the the right div text doesn't move up and get cut off.

Also, the amount the right div moves up is equal to however much the spacing is.

If I set the spacing to something big, like 250px, then when I click the #link it doesn't make it all the way to the top on IE6. It only jumps up so far, but it doesn't appear to be a fixed jump.
On FF, it doesn't matter how big I set the top, it will show up at the top when I click the # link.

phazei

8:38 am on Jun 25, 2008 (gmt 0)

10+ Year Member



It also doesn't exhibit the problem with all internal #links.
Only when it's pointing to the sub-container

phazei

7:31 pm on Jul 2, 2008 (gmt 0)

10+ Year Member



anyone? any clues?

DrDoc

6:11 pm on Jul 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using a valid doctype [w3.org]?