Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > font setting

Reply
Thread Tools

font setting

 
 
Stijn Goris
Guest
Posts: n/a
 
      08-08-2004
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


 
Reply With Quote
 
 
 
 
Sam Hughes
Guest
Posts: n/a
 
      08-08-2004
"Stijn Goris" <(E-Mail Removed)> wrote in news:41164dea$0$317
$(E-Mail Removed):

> 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?



--
In a room with thirty-seven people, never have everybody shake each
other's hand.
 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      08-08-2004
Stijn Goris wrote:

> * {
> 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.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
Neal
Guest
Posts: n/a
 
      08-08-2004
On 8 Aug 2004 16:07:58 GMT, Sam Hughes <(E-Mail Removed)> wrote:


> 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>
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      08-08-2004
Neal wrote:
> Sam Hughes wrote:
>
>> If you want to shrink the font size in that instance, use <small>v1.01
>> </small>, for instance.

>
> 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>.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Now Playing ~ ./space/neighbourhood.ogg

 
Reply With Quote
 
Sam Hughes
Guest
Posts: n/a
 
      08-08-2004
Neal <(E-Mail Removed)> wrote in
news(E-Mail Removed):

> On 8 Aug 2004 16:07:58 GMT, Sam Hughes <(E-Mail Removed)> wrote:
>> 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>


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.



--
In a room with thirty-seven people, never have everybody shake each
other's hand.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing Font, it's Java Font? ot native? how install new font? mttc Java 2 07-03-2009 07:29 PM
How to get the text in html tag.like<div...><font...>Text</font></ =?Utf-8?B?Tmlja3k=?= ASP .Net 2 02-20-2005 03:03 PM
Font class, external font files question Karl Hungus ASP .Net 1 02-04-2004 04:26 PM
JavaRE 1.4.2 font alias in /lib/font.properties (Linux) Nick Spinel Java 0 07-25-2003 08:28 AM
physical font specified but true type font file not available Michael Glavitsch Java 1 07-15-2003 07:09 PM



Advertisments