SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <font> tag in XHTML

    Can someone settle an argument for me...?

    I thought that the <font> tag is being made redundant in the W3C standard but I'm not entirely sure about this. We are in the process of making our intranet W3C-compliant and many areas of text are stylised in such a way that a class is applied to a <font> tag.
    Code:
    eg. <font class="my_style>text to formatted</font>
    My understanding of W3C compliancy was to remove all instances of page formatting tags such as <font> and apply styles to <div>'s and <span>'s instead.

    Any thoughts on this are welcome... even if I'm proven wrong!
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.


  2. #2
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In XHTML 1.0 transitional the <font> tag is deprecated. In XHTML 1.0 strict and XHTML 1.1 it isn't there at all.

    All visual styling should take place using stylesheets, preferably separate but will exist in the head of the document. Inline <style> declarations are also deprecated.

    However, the following would be correct:
    Code:
    <span class="my-style">text to formatted</span>
    as long as .my-style is declared in the CSS. Note that underscores in class names can cause problems so a hyphen has been substituted and all attributes must be enclosed in quotes - a typo in yours meant that the closing quotes were missing.

    P.S. Wave out of the window and I may see you - I'm in Perry Barr.
    Last edited by John Colby; Jan 5, 2004 at 11:11. Reason: added postscript
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  3. #3
    SitePoint Addict naveed's Avatar
    Join Date
    Feb 2003
    Location
    Ottawa, Canada
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Problems with <font> tag:
    http://www.mcsr.olemiss.edu/~mudws/font.html

    Not the most recent article (Netscape 2.0 is mentioned in it!), but it does point out the disadvantages of HTML's styling elements.
    Simply put, <font> should not be used; use <span> instead, as John pointed out.

  4. #4
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great stuff - now I've got ammunition againt my rival!! I've always used <div> and <span> to apply small amounts of styling although I'm a sucker for using the table tags for setting classes (<table>, <tr> & <td>).

    BTW John, I used to live in Great Barr - just off the Walsall Road! It's a small world ay it? <-- (local slang)
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.


  5. #5
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bigsi
    BTW John, I used to live in Great Barr - just off the Walsall Road! It's a small world ay it? <-- (local slang)
    From my office window I can see Barr Beacon. Today I'm working from home. Marking assignments.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  6. #6
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My fiance went to that school!!

    (Sorry for all those reading this post and have no idea what we're going on about - if you want to know, this is Birmingham and surrounding areas we're going on about)
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.


  7. #7
    SitePoint Addict mak-uk's Avatar
    Join Date
    Dec 2001
    Location
    Midlands, UK
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all..

    .. from sunny Balsall Heath

    John Colby.. I don't suppose I could have a copy of your lecture notes for XHTML (that you mentioned in another thread)?

    Thanks.

    Mak

  8. #8
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by bigsi
    (Sorry for all those reading this post and have no idea what we're going on about - if you want to know, this is Birmingham and surrounding areas we're going on about)
    Off Topic:

    Northerners!

  9. #9
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mak-uk
    John Colby.. I don't suppose I could have a copy of your lecture notes for XHTML (that you mentioned in another thread)?
    Replied by PM
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •