Welcome to WebmasterWorld Guest from 54.145.80.57

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)

New User

10+ Year Member

joined:Nov 4, 2002
posts:3
votes: 0


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)

Preferred Member

10+ Year Member

joined:July 20, 2001
posts:449
votes: 0


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)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


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)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts:12169
votes: 55


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)

New User

10+ Year Member

joined:Nov 4, 2002
posts:3
votes: 0


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)

Junior Member

10+ Year Member

joined:Jan 26, 2001
posts:164
votes: 0


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)

New User

10+ Year Member

joined:Nov 4, 2002
posts:3
votes: 0


everything working dandy.

thanx