Closed Bug 656894 Opened 13 years ago Closed 13 years ago

Unexpected margin / padding in Firefox 4 css

Categories

(Firefox :: General, defect)

4.0 Branch
x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 451791

People

(Reporter: mailkistl, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24
Build Identifier:               Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

I've recently started to setup a website and ran into a problem in firefox 4. 
My main navigation bar has an unexpected margin from the top of the page. - Only in Firefox 4. Chrome, IE8, IE9, IE7, Safari work fine. 

Reproducible: Always


Actual Results:  
The margin is still there.

Expected Results:  
Reviewing the css, there should not be a margin. As there is none in all other browsers.
Version: unspecified → 4.0 Branch
Those errors are not really errors. I think the css validator currently (or intentionally) does not recognize vendor specific prefixes.
The selected profile you have used for validating my css  is not correct. It should be css3 not 2.1
Attached file testcase+workaround
Reporter, when you define constant width/height, or especially use float inside the block element, it's hardly recommended to use overflow:hidden rule for the wrapper <div>. This fixes several troubles in IE6/7 too and makes your site cross compatible.

I'm 99.99% sure if this is a dupe of Bug 451791
Attachment #532384 - Attachment mime type: text/plain → text/html
Robert, thank you very much for your testcase and provided workaround.
Unfortunately, I am a bit confused right now.
You tell me that "it's HARDLY recommended to use overflow:hidden rule", but in your provided testcase you suggest using overflow:hidden as a workaround.
All my css files do not contain "overflow:hidden" rul.
Do you mean it's strongly recommended?
A simpler workaround is to add a bit of padding to stop the margins
from collapsing through the clearance.  For example:
<div style='clear:both;padding-bottom:0.1px;'></div>
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: