Reply LinkBack (4) Thread Tools Search this Thread
Old 01-06-2007, 04:46   4 links from elsewhere to this Post. Click to view. #1 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,173
why does Firefox sometimes ignore margins? usually around floats.....

I have been noticing this a lot, on a few different websites I have built. All of my recent work is valid XHTML 1.0 Strict, with a valid doctype, served as text/html, with valid css.

Firefox seems to ignore margin applied to elements that are displayed after floated elements, even when I use display:block;clear:both; it still does not obey the margin.

IE6, IE7 do though.

Anyone else come across this?
  Reply With Quote
Old 01-06-2007, 04:54   #2 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,173
Weird, using !important fixed it:

Code:
margin-bottom: 2em !important;
  Reply With Quote
Old 01-06-2007, 05:38   #3 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,512
Quote:
Originally Posted by freelancr
I have been noticing this a lot, on a few different websites I have built. All of my recent work is valid XHTML 1.0 Strict, with a valid doctype, served as text/html, with valid css.

Firefox seems to ignore margin applied to elements that are displayed after floated elements, even when I use display:block;clear:both; it still does not obey the margin.

IE6, IE7 do though.

Anyone else come across this?

Without seeing any code I couldn't say for sure, but use of clear:both isn't something I'd usually recommend. I'm assuming you're aware of clearfix, it's by far the best way of dealing with clearing floats as it negates any issues with browsers not respecting margins or padding afterwards.
__________________
  Reply With Quote
Old 01-06-2007, 07:32   #4 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,173
Quote:
Originally Posted by cam
use of clear:both isn't something I'd usually recommend.

Ah, I always use it without any troubles in IE6/IE7/FF/Opera.


Quote:
Originally Posted by cam
I'm assuming you're aware of clearfix

I have seen it used on some tutorials I have read, but I assumed it was a fix for shite old browsers like IE5 MAC as I try to avoid using CSS hacks, and tend to go for conditional comments and separate stylesheets instead now.
  Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.designerstalk.com/forums/web-standards/26815-why-does-firefox-sometimes-ignore-margins-usually-around-floats.html
Posted By For Type Date
Show Car Insurance - show kit insurance, show car ins This thread Refback 30-06-2007 10:00
Online Ed - ed plumas online, degree ed online This thread Refback 26-06-2007 16:27
Motorcycle Insurance - credit insurance, companies insurance motorcycle This thread Refback 25-06-2007 14:43
Erie Car Insurance - insurance erie 400, insurance erie agency This thread Refback 21-06-2007 04:16

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8