font setting

Discussion in 'HTML' started by Stijn Goris, Aug 8, 2004.

  1. Stijn Goris

    Stijn Goris Guest

    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
    Stijn Goris, Aug 8, 2004
    #1
    1. Advertising

  2. Stijn Goris

    Sam Hughes Guest

    "Stijn Goris" <> wrote in news:41164dea$0$317
    $:

    > 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.
    Sam Hughes, Aug 8, 2004
    #2
    1. Advertising

  3. 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
    David Dorward, Aug 8, 2004
    #3
  4. Stijn Goris

    Neal Guest

    On 8 Aug 2004 16:07:58 GMT, Sam Hughes <> 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>
    Neal, Aug 8, 2004
    #4
  5. Stijn Goris

    Toby Inkster Guest

    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
    Toby Inkster, Aug 8, 2004
    #5
  6. Stijn Goris

    Sam Hughes Guest

    Neal <> wrote in
    news:eek::

    > On 8 Aug 2004 16:07:58 GMT, Sam Hughes <> 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.
    Sam Hughes, Aug 8, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karl Hungus

    Font class, external font files question

    Karl Hungus, Feb 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    526
    Karl Hungus
    Feb 4, 2004
  2. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    710
    Matt Berther
    Feb 20, 2005
  3. Michael Glavitsch
    Replies:
    1
    Views:
    763
    Roedy Green
    Jul 15, 2003
  4. Nick Spinel
    Replies:
    0
    Views:
    936
    Nick Spinel
    Jul 25, 2003
  5. mttc
    Replies:
    2
    Views:
    2,388
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page