How to NOT use the font tag

Discussion in 'HTML' started by Chris Leonard, Oct 31, 2003.

  1. Can someone help me with this problem please.

    I'm converting my site and trying to make it all w3c compliant, so I'm
    using CSS instead of the older style HTML tags. All is going well, but then
    I hit a problem.

    Here is the old code:

    <font size="10">One</font>&nbsp;
    <font size="20">Two</font>&nbsp;
    <font size="30">Three</font>&nbsp;

    Output would be One Two Three (but they go up in size!)

    How do you do this in CSS please ?

    I will eventually want to use different font styles and I'll come across the
    same issue no doubt. I'd thought of using three DIVs and positioning them
    all one after the other, but isn't that over kill ? maybe it's not.

    Your comments please.

    Thanks

    Chris
    Chris Leonard, Oct 31, 2003
    #1
    1. Advertising

  2. Chris Leonard

    kayodeok Guest

    "Chris Leonard" <> wrote in
    news:bnui4c$6e1$:

    > Can someone help me with this problem please.
    >
    > I'm converting my site and trying to make it all w3c compliant,
    > so I'm using CSS instead of the older style HTML tags. All is
    > going well, but then I hit a problem.
    >
    > Here is the old code:
    >
    > <font size="10">One</font>&nbsp;
    > <font size="20">Two</font>&nbsp;
    > <font size="30">Three</font>&nbsp;
    >
    > Output would be One Two Three (but they go up in size!)
    >
    > How do you do this in CSS please ?


    I am not familiar with font sizes and I am making an assumption
    on your page structure:

    <style type="text/css">
    #small {font-size:100%}
    #medium {font-size:110%}
    #big {font-size:120%}

    </style>

    <p><span id="small"> One </span><span id="medium"> Two </span><span id="big"> Three </span></p>

    Change the font sizes as you see fit

    --
    Kayode Okeyode
    http://www.kayodeok.co.uk/weblog/
    kayodeok, Oct 31, 2003
    #2
    1. Advertising

  3. "Chris Leonard" <> wrote:

    > Here is the old code:
    > <font size="10">One</font>&nbsp;
    > <font size="20">Two</font>&nbsp;
    > <font size="30">Three</font>&nbsp;
    > Output would be One Two Three (but they go up in size!)
    > How do you do this in CSS please ?


    Zero
    <big>One
    <big>Two
    <big>Three
    <big>Four
    <big>Five
    </big></big></big></big></big>

    --
    Meanwhile at the Google Ranch ...
    "I can't read this bloody site; it's all Falsh and JavaScrap."
    "Forget it and move on! Still 2 718 281 828 pages to crawl."
    Andreas Prilop, Oct 31, 2003
    #3
  4. "Chris Leonard" <> wrote:

    > I'm converting my site and trying to make it all w3c compliant,


    Why? It's generally useful to follow W3C recommendations, with due critical
    considerations, but seldom productive to just convert a site in order to
    comply with them. If you are _redesigning_ a site, then it's a different
    issue, but then it's mostly not conversion but... redesign.

    But why don't you post the URL?

    > Here is the old code:
    >
    > <font size="10">One</font>&nbsp;
    > <font size="20">Two</font>&nbsp;
    > <font size="30">Three</font>&nbsp;


    What could possibly be the reason for _that_? Is this a real example? If
    not, why not?

    The size attribute of <font> has a defined meaning only when its value is
    an unsigned integer from 1 to 7 or a signed integer which yields such an
    integer when added to the current base font size value. So those tags have
    no defined meaning.

    If you just want the font size to increase, for some odd reason, then you
    simply set the font-size property in CSS. How you do that really depends on
    how big they should be, and this depends on the purpose and context.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Oct 31, 2003
    #4
  5. > </style>
    >
    > <p><span id="small"> One </span><span id="medium"> Two </span><span

    id="big"> Three </span></p>
    >

    Brill, thanks
    Chris Leonard, Oct 31, 2003
    #5
  6. kayodeok wrote:

    > <p><span id="small"> One </span><span id="medium"> Two </span><span
    > id="big"> Three </span></p>


    Of course that's not a very good example, but given the original question
    its difficult to come up with one.

    * Is it really a paragraph?
    * Could the three words be better described in markup?
    * Would there be a wish to reuse the styles somewhere else on the page?
    (Because id isn't a good idea then)
    * The value of id attributes should describe the meaning, not the
    appearance, of the element they apply to.

    --
    David Dorward http://dorward.me.uk/
    David Dorward, Nov 1, 2003
    #6
  7. Chris Leonard

    kayodeok Guest

    David Dorward <> wrote in
    news:bnvuof$a3s$1$:

    > kayodeok wrote:
    >
    >> <p><span id="small"> One </span><span id="medium"> Two
    >> </span><span id="big"> Three </span></p>

    >
    > Of course that's not a very good example, but given the original
    > question its difficult to come up with one.
    >
    > * Is it really a paragraph?
    > * Could the three words be better described in markup?
    > * Would there be a wish to reuse the styles somewhere else on
    > the page? (Because id isn't a good idea then)
    > * The value of id attributes should describe the meaning, not
    > the appearance, of the element they apply to.
    >


    David, I struggled with the value of the id attributes but I had no
    idea what he was trying to do...

    The rest of you comments are valid by the way.

    --
    Kayode Okeyode
    http://www.kayodeok.co.uk/weblog/
    kayodeok, Nov 1, 2003
    #7
  8. kayodeok wrote:

    >> Of course that's not a very good example, but given the original
    >> question its difficult to come up with one.


    > David, I struggled with the value of the id attributes but I had no
    > idea what he was trying to do...


    Exactly :)

    --
    David Dorward http://dorward.me.uk/
    David Dorward, Nov 1, 2003
    #8
  9. Chris Leonard

    rf Guest

    "David Dorward" <> wrote in message
    news:bo00t6$p03$2$...
    > kayodeok wrote:
    >
    > >> Of course that's not a very good example, but given the original
    > >> question its difficult to come up with one.

    >
    > > David, I struggled with the value of the id attributes but I had no
    > > idea what he was trying to do...

    >
    > Exactly :)


    It's part of a mass bungie jumping competition page?

    <site location="bridge">
    <big>one<big>two<big>three<reallybig>JUMP
    </reallybig></big></big></big>
    </site>

    Cheers
    Richard.
    rf, Nov 1, 2003
    #9
  10. > > * Is it really a paragraph?
    > > * Could the three words be better described in markup?
    > > * Would there be a wish to reuse the styles somewhere else on
    > > the page? (Because id isn't a good idea then)
    > > * The value of id attributes should describe the meaning, not
    > > the appearance, of the element they apply to.
    > >

    Guys.

    The example I gave was one I felt best described my problem in an easy to
    understand way. The solution was excellent, what I had not understood was
    that there was such a thing as the <span> tag.

    You were quite right David, id is not always the best one to use and I found
    this out by validating the site! It wouldn't validate with "id" but it would
    with "class" - problem, I used ASP to pick info out of a DB and display it
    so I'd used "id=xyz" about 5 times! swapped it to class and bingo.

    Thanks once again for your help.

    Chris
    Chris Leonard, Nov 1, 2003
    #10
    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. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    696
    Matt Berther
    Feb 20, 2005
  2. Michael Glavitsch
    Replies:
    1
    Views:
    747
    Roedy Green
    Jul 15, 2003
  3. gino
    Replies:
    3
    Views:
    3,959
    Mike Smith
    Jul 11, 2004
  4. shruds
    Replies:
    1
    Views:
    758
    John C. Bollinger
    Jan 27, 2006
  5. mttc
    Replies:
    2
    Views:
    2,371
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page