homepage Welcome to WebmasterWorld Guest from 54.242.200.172
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: DrDoc

CSS Forum

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




msg:1199496
 3:59 am on Nov 4, 2002 (gmt 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?

 

rjohara




msg:1199497
 4:17 am on Nov 4, 2002 (gmt 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.

tedster




msg:1199498
 4:52 am on Nov 4, 2002 (gmt 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.

pageoneresults




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

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.

napot




msg:1199500
 3:17 am on Nov 5, 2002 (gmt 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.

crash




msg:1199501
 5:43 am on Nov 5, 2002 (gmt 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?

napot




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

everything working dandy.

thanx

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved