Welcome to WebmasterWorld Guest from 54.197.171.28

Forum Moderators: not2easy

Message Too Old, No Replies

Text size

body text is affected by all css rules except text size.

   
3:59 am on Nov 4, 2002 (gmt 0)

10+ Year Member



Hi,

I am using a css file for the body content and the font-family and background-color are being applied except for the font-size. this is what i have written:

body {
background-color: #666699;
font-family: verdana;
font-size: 9pt;
color: #ffffff;
}

any suggestions?

4:17 am on Nov 4, 2002 (gmt 0)

10+ Year Member



Welcome to the group. When you say the font-size "isn't being applied", can you be more specific? What exactly are you seeing under different browser settings? (And you might also want add a generic "sans-serif" after verdana as the fall-back.)

Font size is a tricky subject, and most people would recommend against using points as a unit; ems or %s in general are better, pixels are popular for rigid control, but there is often not a clear cut solution. (And in many cases a good old <small> tag is best.) If you search WebmasterWorld for "font size css" you will find lots of general information.

4:52 am on Nov 4, 2002 (gmt 0)

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



Many browsers do a lousy job of inheriting styles from the body element. So many are flawed, in fact, that I stopped keeping track.

The answer (it's just a reality, not the ideal) is to set font styles in p, td, li, div, a, or wherever else they are going to be applied. It works, and it's dependable.

But if you use the body tag you get very inconsistent cross-browser results.

5:02 am on Nov 4, 2002 (gmt 0)

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



After dealing with this issue for a couple of years myself, I recently picked up this tip here at the forums...

blockquote, body, div, form, h1, h2, h3, h4, h5, h6, input, li, ol, p, select, td, textarea, tr, ul{font-family:verdana,arial,helvetica,sans-serif;font-size:13px;color:#808080;background:transparent;}

This covers the basics and allows you to keep your style sheet trim.

3:17 am on Nov 5, 2002 (gmt 0)

10+ Year Member



My apologies for not being clear enough on this matter. What I was trying to say is that the style is not fully inherited. i.e. only the background color, the font family and the text color are inherited by my web site But no thte font size. I have tried using pixels too but it still won't inherit the font size.

I will try a coulpe of more things but I am seriously thinking on giving up on the body element and using, td, or a, or something more reliable.

thanks for the help.

5:43 am on Nov 5, 2002 (gmt 0)

10+ Year Member



It depends on what browser your viewing with. As others have stated I also cover all the basics with one tag:

body, table, td, tr, div, p {font-family: 12px; }

that said, do you have something that's conflicting with the size over riding your css?

11:19 pm on Nov 5, 2002 (gmt 0)

10+ Year Member



everything working dandy.

thanx