473,770 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clarification on Font Size and Inheritance.

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.

Jan 11 '06 #1
36 3363
On 11/01/2006 13:16, Viken Karaguesian wrote:

[snip]
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]
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]
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.
Jan 11 '06 #2
On 11 Jan 2006, Viken Karaguesian wrote:
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.lan g>

Jan 11 '06 #3
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.

Jan 11 '06 #4
Thanks for the reply Michael.

Jan 11 '06 #5
On 11 Jan 2006, Viken Karaguesian wrote:
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.lan g>

Jan 11 '06 #6
Viken Karaguesian wrote:
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%; }
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
Jan 11 '06 #7
In article <11************ **********@g43g 2000cwa.googleg roups.com>,
Viken Karaguesian <vi****@aol.com > wrote:
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
Jan 11 '06 #8
On 11/01/2006 14:29, Michael Winter wrote:

[snip]
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.
Jan 11 '06 #9
On Wed, 11 Jan 2006, Eric Kenneth Bustad wrote:
Viken Karaguesian <vi****@aol.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.
Jan 11 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
4651
by: Luke Duddridge | last post by:
Hello, I work for a local council and have recently been part of the project for a new website design which went live at the end of september at www.tauntondeane.gov.uk. I set the relative sizes on the CSS so that the page would be best sized with Microsoft IE set to view:text size:Medium(which I assume is the default value) as not many people know that the size of the browser text can be changed.
2
1944
by: Haines Brown | last post by:
I don't understand the inheritance logic in this situation. Let me describe a simple situation: I have a document with a style sheet that specifies: address, blockquote, caption, center, dd, dir, div, dl, dt, form, hr, menu, ol, p, td, th, ul { font-size: 100%; } body { font: 100% serif, "Times New Roman","Times Roman";
7
19488
by: Fabian Neumann | last post by:
Hi! I got a problem with font-family inheritance. Let's say I have CSS definitions like: p { font:normal 10pt Verdana; } strong { font:normal 14pt inherit;
4
3207
by: Cezar | last post by:
Hi there. On this page: http://www.helpdeskics.com/ in the blue menu and footer font size in Opera is less than in other browsers. Why ? I don't know how can I set correct font size for Opera. -- Regards, Cezar.
15
2459
by: srampally | last post by:
The following code works in firefox. But IE displays the hyperlink at font-size=13 rather than font-size=10. Why? If its a known IE bug, how should I fix it? I always want the hyperlinks to take the size of the next parent element's class. thanks for the help, Shashi
30
4544
by: Takehiko Abe | last post by:
I have a <pelement with <ttinside: ;;; <p>A paragraph contains <tt>tt element</tt>.</p> I would like to set the font-size of the TT to the same as the containing <p>. This does not seem to work: ;;; p {
18
25006
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin, that IE7 does not seem to offer any way to control the font size of a text input element.
14
2829
by: Roedy Green | last post by:
Is there a shortcut way to define the default font family (and characteristics) to be applied to all styles? -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
0
9595
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7420
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.