HighDots Forums  

Clarification on Font Size and Inheritance.

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Clarification on Font Size and Inheritance. in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Viken Karaguesian
 
Posts: n/a

Default Clarification on Font Size and Inheritance. - 01-11-2006 , 07:16 AM






Hello all,

I just need confirmation on the subject of font size and its
inheritance. Take this example:

body {
font-family: arial;
font-size: 95%;
}

p.fineprint {
font-size: 75%;
}

Is the font size in the p.fineprint set to 75% of the *value in the
body*? So in this case, it would be 75% of the 95% in the body. My
experiments seem to show that that's the case, but I just need some
confirmation.

Also, how do EM and % compare? Setting the font to 1em seems to be the
same as setting it to 100%, .90em seems the same as 90%. What are the
technical differences? In which cases should/would I use one over the
other?

Thanks everyone.

Viken K.


Reply With Quote
  #2  
Old   
Michael Winter
 
Posts: n/a

Default Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 08:29 AM






On 11/01/2006 13:16, Viken Karaguesian wrote:

[snip]

Quote:
body {
font-family: arial;
font-size: 95%;
}

p.fineprint {
font-size: 75%;
}

Is the font size in the p.fineprint set to 75% of the *value in the
body*?
Assuming that there are no intervening font-size declarations, yes.

[snip]

Quote:
Also, how do EM and % compare?
They are directly proportional. A length of 1em equals the computed
value of the font-size property. Furthermore, if the value of a
font-size property is 1em, it equals 100% of the parent font size.

This is explained in the CSS Specification, in 4.3.2 Lengths.

[snip]

Quote:
What are the technical differences? In which cases should/would I use
one over the other?
I would recommend that you always use percentages, especially if nesting
font-size declarations. IE fails to calculate these properly.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.


Reply With Quote
  #3  
Old   
Andreas Prilop
 
Posts: n/a

Default Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 08:59 AM



On 11 Jan 2006, Viken Karaguesian wrote:

Quote:
body {
font-size: 95%;
This is naughty! If you specify any font size for BODY, then
take 100% only.

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lang>



Reply With Quote
  #4  
Old   
Viken Karaguesian
 
Posts: n/a

Default Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 09:21 AM



Any reason to set the font-size at 100% only? Since the font-size is
inherited, specifying the font-size for a site in the body means I
don't have to repeat it for <p>, <ul>, <li>, <div>, <td>, etc.

If I set the body to 100% but really want my font-size to be 95%, then
I'd have to specify it for all tags, right?

Viken K.


Reply With Quote
  #5  
Old   
Viken Karaguesian
 
Posts: n/a

Default Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 09:24 AM



Thanks for the reply Michael.


Reply With Quote
  #6  
Old   
Eric Kenneth Bustad
 
Posts: n/a

Default Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 09:29 AM



In article <1136992877.292413.288670 (AT) g43g2000cwa (DOT) googlegroups.com>,
Viken Karaguesian <vikenk (AT) aol (DOT) com> wrote:
Quote:
Any reason to set the font-size at 100% only? Since the font-size is
inherited, specifying the font-size for a site in the body means I
don't have to repeat it for <p>, <ul>, <li>, <div>, <td>, etc.

If I set the body to 100% but really want my font-size to be 95%, then
I'd have to specify it for all tags, right?
That is 95% of what the user's browser is configured to use as the
default text size. Presumably that default is what the user prefers.
So why do you want it smaller?

--
= Eric Bustad, Norwegian Bachelor Programmer


Reply With Quote
  #7  
Old   
Andreas Prilop
 
Posts: n/a

Default Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 09:29 AM



On 11 Jan 2006, Viken Karaguesian wrote:

Quote:
really want my font-size to be 95%,
Why? Stop wanting that! 100% is the reader's preferred size.
Setting the body font size to anything smaller, means to annoy
the reader.

You could set the font size of footnotes, legalese phrases
and such to something smaller than 100%.

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lang>



Reply With Quote
  #8  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 09:32 AM



Viken Karaguesian wrote:

Quote:
Any reason to set the font-size at 100% only? Since the font-size is
inherited, specifying the font-size for a site in the body means I
don't have to repeat it for <p>, <ul>, <li>, <div>, <td>, etc.
If set in body, no other element needs a font size, except perhaps the
headings (h1, h2, etc) and legalese.

body { font-size: 100%; }
h1 { font-size: 140%; }
h2 { font-size: 125%; }
..legalese { font-size: 85%; }

Quote:
If I set the body to 100% but really want my font-size to be 95%, then
I'd have to specify it for all tags, right?
No. If you personally like smaller text, set your own browser's default
size a bit smaller. But leave your web pages at *our* default size.

Please see this page as well:
http://www.safalra.com/special/googlegroupsreply/

--
-bts
-Warning: I brake for lawn deer


Reply With Quote
  #9  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 09:51 AM



On Wed, 11 Jan 2006, Eric Kenneth Bustad wrote:

Quote:
Viken Karaguesian <vikenk (AT) aol (DOT) com> wrote:

If I set the body to 100% but really want my font-size to be 95%, then
I'd have to specify it for all tags, right?

That is 95% of what the user's browser is configured to use as the
default text size. Presumably that default is what the user prefers.
So why do you want it smaller?
It's the modern example of "Optimized for arguing with customers",
don't you know?

As the author of that original article wrote, years ago, when
Windows 95 was state of the art, and 800x600 was a large display:

There is a saying in marketing (at least in Germany): 'No one has
ever won an argument with a customer'. Visitors to your site are your
customers, and if you tell them their configuration is not right, you
are arguing.

But there are web site authors who still don't want to know.


Reply With Quote
  #10  
Old   
Michael Winter
 
Posts: n/a

Default [Clarification] Re: Clarification on Font Size and Inheritance. - 01-11-2006 , 09:55 AM



On 11/01/2006 14:29, Michael Winter wrote:

[snip]

Quote:
I would recommend that you always use percentages, especially if nesting
font-size declarations. IE fails to calculate these properly.
^^^^^
By 'these', I was referring to nested font-size declarations that use em
values. Sorry if that wasn't clear.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.