Welcome to WebmasterWorld Guest from 107.21.159.218

Forum Moderators: not2easy

Message Too Old, No Replies

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

     

visu

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

5+ Year Member



Can anyone tell me why this not works in FF?

/* CSS */

BODY{
font-family:verdana;
font-size:1px;
}

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?

SuzyUK

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

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



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

poppyrich

5:05 pm on May 31, 2008 (gmt 0)

5+ Year Member



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.

choster

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

WebmasterWorld Senior Member 10+ Year Member



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month