Click to See Complete Forum and Search --> : Font sizing - CSS vs HTML


Patrick Skelly
01-05-2004, 06:11 PM
I am trying to drag myself from vanilla HTML into CSS augmentation.

CSS <span style="font-size: smaller;>
appears to be equivalent in effect to
HTML <font size="-1"> .

Is there an equivalent in effect to
HTML <font size="-2"> ?

Paul Jr
01-05-2004, 06:23 PM
<span style="font-size:x-small;">Hello out there.</span>

pyro
01-05-2004, 06:25 PM
smaller is a relative size, so it will not always map to font size="-1". It id dependent on what the current font size is. See http://www.w3.org/TR/REC-CSS2/fonts.html#font-size-props for more info on font sizing.

TomDenver
01-05-2004, 08:19 PM
I have a related question. I've been using CSS to control font sizes for a long time, but often using px. What are the advantages/disadvantages of using, px, em or pt?

Also, while we're talking about fonts, why is <strong> better than <b>? I use CSS generally so I don't use either tag much. Same question for <i> vs. the other italic tag (I can't remember this tag name).

pyro
01-05-2004, 08:22 PM
I'm going to hit your second question, and then try to dig up some links, as your first is rather complex. ;)

The reason that <strong> and <em> are better than <b> and <i> are because the former two have sematic meaning. <b> and <i> are mearly presentational tags, which mean nothing at all stucturally. Read http://www.ryanbrill.com/archives/00010.php for a bit more info.

pyro
01-05-2004, 08:31 PM
Alright, dug up a few. This topic is rather controversial, as none of the methods are ideal. IMO, specifing your fonts with em or % is probably best, though. Why? Accessiblity. IE (All Windows versions) do not allow users to (easily) resize font's. This is obviously a problem. With ems or percentages, those problems do not exist, though a whole new set do...

http://css-discuss.incutio.com/?page=FontSize
http://www.alistapart.com/articles/sizematters/
http://old.alistapart.com/stories/fear4/ - Zeldman's controversial article
http://www.thenoodleincident.com/tutorials/box_lesson/font/index.html

TomDenver
01-05-2004, 08:45 PM
Thanks for the links Pyro. I still probably will never use <strong> or <em> but then I never use <b> or <i> either. It's just nice to know why one should be used over the other if I ever do use them.

I'll tinker with my site and see how using % will change things for me.

pyro
01-05-2004, 08:54 PM
You are welcome, and good luck. :)

Aronya1
01-06-2004, 03:08 PM
Originally posted by TomDenver
I still probably will never use <strong> or <em> but then I never use <b> or <i> either.

Out of curiosity, what DO you use if you want to accentuate a word? Probably I'm just having a brain fart & will smell it when you answer my question, but what other choices are there to accomplish the same thing? Or do you just never have a need?

pyro
01-06-2004, 03:39 PM
What's wrong with <strong> and <em>? Maybe I don't understand your question...?

TomDenver
01-06-2004, 04:22 PM
I use CSS font-weight:700;. I don't have a need to just make one word bold usually. If I only needed one word bold in a sentence, then I'd use <strong>.

pyro
01-06-2004, 04:31 PM
If you only need one word bold, just because that is how you want it to appear, you should probably use <span style="font-weight: bold;">bold text</span> as <strong> is used to designate strong emphasis.

Patrick Skelly
01-11-2004, 09:16 AM
Thanks for all the comments and the interesting tangents.

Sometime back in the last millenium I used to speak "semiotics", but I gave it up. It turned out to be more fun to do something than to think about it. In the final analysis, in both human and computer senses, an emphatic statement is a strong statement is a bold statement.

Back to the reason for my initial query. I've never had the chutzpah to tell users what font faces, sizes, or families they should use to view my work; that's their decision - by choice, default, or situation. Nor dare I assume that 'my' viewers have state-of-the-art hardware, software, or access.

The words should be what matter, not their glitz and glitter. Even so, there are occasions - footers, copyright notices, date or location flags primarily for my own benefit - when I am comfortable de-emphasizing something with a size="-1" or even size="-2". As I add CSS1 to my HTML 3.2 now, I'll now settle for an occasional "smaller" for both down-sizings.

On the secondary discussion about font-style, I'd become used to using %lt;b&gt;, %lt;i&gt;, and %lt;u&gt; because I am placing printed documents online for military history research (milhist.net); they were clear, simple, brief. I'm just trying to prepare for the day when more complicated browsers will no longer accept those constructs

I've kept a note from a mathematical logic course I took many years ago; it seems appropriate here:
If and only if you can prove "P if and only if Q",
Q is called a necessary and sufficient condition for P.
- Matt Hassett
In which level of metalanguage are you now speaking ?
- Pat Skelly