Philippe Wittenbergh wrote:
On Sep 4, 2010, at 1:08 PM, John D wrote:
Does any one know the CSS equivalent of html font size=x?
[...]
here you go:
http://www.w3.org/TR/CSS21/fonts.html#propdef-font-size
The text there says that the table "provides user agents guidelines", and
the notes there make it clear that the size keywords in CSS have a messy
history. The only thing that you can really expect from them, in theory and
in practice, is that they form a ordinal scale, and not even strictly
ordered: xx-small is less than or equal to x-small, which is less than or
equal to small, etc.
It's easy to see that the table does not describe common reality, by e.g.
throwing
<font size=6>T</font><span style="font-size:xx-large">T</span>
at Internet Explorer in Quirks Mode. The T's should be equal size according
to the table, but they surely aren't. The entire range of font size keywords
is interpreted differently in the two modes of IE.
Making your document so that IE treats it in "Standards Mode", and ignoring
old IE versions that have no such mode, you might expect to get the
correspondence given in the table.
But why? The only situation where the mapping would be relevant would be a
mix of CSS styling and HTML formatting, basically if you have an old
document that uses <font size=...> and you would want to use CSS for
additions and modifications. But it's more natural, and safer, to set the
font size the same way (either HTML or CSS) if you want two elements to have
the same font size.
And if you want to change a document to use CSS-based font size settings
instead of using HTML-based font size settings, it is better to consider
which percentage sizes are most suitable for the specific document and its
specific elements. HTML gives very coarse font size control, which is in
addition defined to be browser-dependent (as are the CSS font size
keywords), so when styling with CSS, you should make use of the better
facilities of CSS. Instead of wondering whether <font size=2> maps to small
or medium or x-small, you could ask whether e.g. font-size: 90% or
font-size: 85% or something between leads to a suitable rendering.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/