font setting

S

Stijn Goris

hi all,

My stilesheet defines
* {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
}

I want to set text that has size 9 so I declared
<font size="-1">v1.01</font>

Won't work.

Someone has a better idea?

thank

Stijn
 
S

Sam Hughes

hi all,

My stilesheet defines
* {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
}

I want to set text that has size 9 so I declared
<font size="-1">v1.01</font>

Won't work.

Someone has a better idea?

Sure. Don't use px sizes to set font sizes. IE users can't resize their
fonts if you do so. It's best to keep the font at the default sizes --
after all, that's the user's preference.

The reason your effort doesn't work is because the asterisk refers to
_all_ elements. Thus the font element will have a size of ten pixels no
matter what. Unless you do something to override that CSS.

What you _should_ do is use body { font-size: 1em; font-family: etc..;}
instead.

If you want to shrink the font size in that instance, use <small>v1.01
</small>, for instance. But doesn't the viewer know what fonts he likes
best?
 
D

David Dorward

Stijn said:
* {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
}

Yuck. Why not respect the user's preferences instead of forcing a
unreadable-to-many size on them?

http://css-discuss.incutio.com/?page=UsingPixels
I want to set text that has size 9 so I declared
<font size="-1">v1.01</font>

Well of course.

1. <font> is deprecard and should not be used
2. You have defined all elements as being of 10px in font size, so <font
size="-1"> gains the style and sets any text inside to 10px also.
 
N

Neal

What you _should_ do is use body { font-size: 1em; font-family: etc..;}
instead.

Actually, 100% is better than 1em in this case, as it avoids a rendering
issue with IE. Or, state no font-size at all. Either way, you can later
use ems or % to modify descendant elements.
If you want to shrink the font size in that instance, use <small>v1.01
</small>, for instance. But doesn't the viewer know what fonts he likes
best?

Certainly. If you need small lettering, though, better than using HTML to
affect the presentation, use CSS. The class name should describe the
content which the author wants made smaller.

..version {font-size: 90%; color: olive; background-color: inherit}

<h2>Software Title <span class="version">v1.01</span></h2>
 
T

Toby Inkster

Neal said:
Certainly. If you need small lettering, though, better than using HTML to
affect the presentation, use CSS.

I feel the need to stick up for the much maligned <small> element. It
fills big gap in the HTML spec. There is no other element that can be used
sensibly as an opposite for <strong>.
 
S

Sam Hughes

Certainly. If you need small lettering, though, better than using HTML
to affect the presentation, use CSS. The class name should describe
the content which the author wants made smaller.

.version {font-size: 90%; color: olive; background-color: inherit}

<h2>Software Title <span class="version">v1.01</span></h2>

I disagree. Span should be used only as a last resort. The use of
<small> at least provides the user-agent _some_ information, for instance
indicating that the enclosed content is de-emphasized. For instance, a
speech browser might revert from its "H2" voice level to the normal one,
emphasizing the text "Software Title" because it is in a heading, but
deëmphasizing "v1.01" back to the normal volume level. The use of <span>
does not provide any of this information and does little more than to
propound a need for more cascading soup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top