2 replies [Last post]
dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 7 years 9 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

Here's a funny one, specifically in Moz1.0:

HTML 1 shows a body DIV with a navigation DIV floated right. There is no padding declared in the BODY. margin-top is set to 20px. IE puts the top of both DIVS 20px down; Moz ignores the body div.

In HTML 2 I've added 1px padding-top to the body. Now Moz shows both 21px down, IE puts the body at 20px and the navbar at 21px.

I'm wondering why Moz is ignoring my margin-top when there's no padding involved - same effect happens if padding in the BODY is set to 0.

I know why IE does what it does!

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

Larersia
Larersia's picture
Offline
newbie
UK
Last seen: 19 years 44 weeks ago
UK
Joined: 2003-05-27
Posts: 6
Points: 0

Bug?

If you comment out the nav box it adds the top margin. Add the nav back in disappears. Add the nav block below the body block and the body is still move down by margin top. According to the CSS1 spec, if I'm reading it correctly, the two blocks with no padding or content between them should collapse the margin between them to the greater of two adjacent margin values (if I'm misreading this please clarify it for me)

A quick check of the Bugzilla does bring up any bugs that seem to relate to this particular matter. Maybe worth filling a bug to see what their official response is?

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 7 years 9 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

margin-top on DIVs

Dodgy. Thankfully a couple of changes on the site means that the 1px difference no longer put two lines in different places (well it does but it's not noticable any more). Was just playing around with ideas and thought it was a bit strange.

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.