Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

font-size:1px in body tag not works in firefox

6:01 am on May 28, 2008 (gmt 0)

New User

10+ Year Member

joined:May 24, 2006
posts: 13
votes: 0

Can anyone tell me why this not works in FF?

/* CSS */


I ve kept the above piece of css in my page . and applied <br> tags to enforce some space between tables. this is works fine in IE and all my <br> tags are rendered with a font size of 1px in IE . but not exactly in the Firefox . it shows huge gaps wherever i used <br> tags.i think the font-size for <br> tags in FF not set to 1px.

why this 1px font size is not supported in Firefox? any other way to make my br are treated with 1px font size?

7:19 am on May 28, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 1, 2002
votes: 0

hi visu

you shouldn't really be controlling the size of your gaps between elements using a <br>, you should really just use a margin directly on your tables and not use the <br> at all, setting a font-size of 1px onto the body seems like it would cause a lot more problems than it would fix

perhaps something like

table {margin-bottom: 3px;}
would be more x-browser friendly
5:05 pm on May 31, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Sept 5, 2007
votes: 0

visu, I agree with SuzyUK's advice to you.

FireFox puts a default "floor" on how small font-size will display. This is designed to preserve readability. It makes complete sense.

However, if you're hell-bent on using BR why use font-size? I've never done it, but I know of no reason why a height cannot be set for a BR element.

6:50 pm on June 3, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 17, 2001
votes: 0

SuzyUK is absolutely right, and in fact some have argued that the <br> element itself is unnecessary.

But the immediate answer to the question is to set line-height to 1px in addition to font-size.