SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Hybrid View

  1. #1
    SitePoint Enthusiast buffyspazz's Avatar
    Join Date
    Jan 2002
    Location
    Richmond, VA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question XHTML and <font> tag

    I've been reading up on XHTML, just to see what it's all about, and I read that XHTML 1.1 (and I think even XHTML 1.0 if you adhere to the the Strict DTD) wouldn't support the <font> tag anymore. I know I must just be having a moment (or two, or three, or a million) of diminished brain power, but can someone tell me what you would use instead? What attribute would you apply your CSS to? <span>? <p>? Something else? Or would it just depend?

    I guess I'm just so used to the <font> tag I'm having trouble wrapping my brain around not using it anymore (not that I have to stop using it RIGHT THIS MINUTE, but you know, for future compliance). I understand that XHTML is meant to take advantage of CSS, which I'm all for, but man...no <font> tag? Is nothing sacred?

    Also, is there any place to get a real person's guide to what tags are deprecated in both XHTML 1.0 strict and XHTML 1.1 (is XHTML 1.1 even finalized yet)? I've looked at the strict XHTML 1.0 DTD, I can't tell a thing from it, and I can't seem turn up anything else that I can understand. *sigh*

  2. #2
    SitePoint Addict
    Join Date
    Jul 2001
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CSS can be applied to almost any html tag, like you mentioned span, p, and also div, body, td, and so on...

    All you have to do is define your font properties in either a class, id or inline and you are set to go.

    If you visit my site link below, click on CSS then on FONT and that should give you some ideas on how to declare your css for fonts.

  3. #3
    SitePoint Enthusiast buffyspazz's Avatar
    Join Date
    Jan 2002
    Location
    Richmond, VA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ok...

    Gotcha...I've been using font classes, but usually I put them in as:

    <font class="classname">Blah Blah Blah</font>

    I can see now that just applying the class to the various tags (<p>, etc. etc.) is easier - I don't know why this didn't occur to me before...but hey, better late than never!


  4. #4
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XHTML and <font> tag

    Originally posted by buffyspazz
    ... Also, is there any place to get a real person's guide to what tags are deprecated in both XHTML 1.0 strict and XHTML 1.1 (is XHTML 1.1 even finalized yet)? I've looked at the strict XHTML 1.0 DTD, I can't tell a thing from it, and I can't seem turn up anything else that I can understand. *sigh*
    Give this a try -- it's fairly easy to browse and the corresponding DTD that supports a given tag is listed at the right as well as referenced at the top of the page.

    http://www.w3schools.com/xhtml/xhtml_reference.asp

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  5. #5
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <font> <b> <i> <u> are depricated in xhtml 1.0 transitional, and not allowed in any higher version or the strict version. Rather use <strong> <em> <div> <span> <p> for these kind of things.

  6. #6
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do not believe strong or em should be in the list either. They both denote a bolded or italicized appearance rather than act as a container element. Why use strong when one can use font-weight : bold ; or em when font-style : italic ; will suffice? I'll have to check, but I don't think strong and em are valid.

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  7. #7
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They're valid and should be.

    <STRONG> and <EM> holds special meaning beyond bold or italicized text: both denote emphasis (<STRONG> having more weight then <EM>). The way browsers choose to display them by default is up to them, really.

    On the same topic, don't use them just to make something bold or italicized -- before you use them, think about what they're being used for. For instance, if you wanted to draw attention to the topic sentence of a paragraph or perhaps to key words, names and dates, that'll be structural and it's fine to use them. However, if you just wanted to make all links in a navigational bar bold or make your headlines italicized, then that's presentational and should be handled by CSS and not the document's markup.

    Does this all make since?

  8. #8
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but man...no <font> tag? Is nothing sacred?
    <font> tags were never sacred. They were a poorly thouaght-out proprietary tag added by Netscape (back when it was still market leader) designed to get around the limitations of the HTML spec back in those days.

    Whenever I see code that looks like this:
    Code:
    <p><font face="arial"><font size="1"><font color="#ffffff">Bleh</font></font></font>
    It makes me wanna hurt the authors of crappy WYSIWYG html editors that encourage this kind of garbage.....
    THE INSTRUCTIONS BELOW ARE OLD AND MAY BE INACCURATE.
    THIS INSTALL METHOD IS NOT RECOMMENDED, IT MAY RUN
    OVER YOUR DOG. <-- MediaWiki installation guide

  9. #9
    SitePoint Guru
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CSS font specification still leaves a lot to be desired. I know it's the way to go, but I miss the font tags sometimes. Well, I still use them in some sites, but not in new stuff. With CSS, percentages and ems seem to present a lot of problems and fixed is sort of antithetical to the whole point of things like
    CSS, I'd think. The flexibility of CSS for type is wonderful, but at the same time it's made a very simple thing pretty complicated.

  10. #10
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh bah -- CSS is not complex at all! You know not of what you speak, my friend.

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  11. #11
    SitePoint Guru
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may be right. It's not complex..type anyway...if you use fixed font sizes. If you object to that concept it isn't all that simple to get everything to display in a way that makes sense in all standards compliant browsers. At least people with more expertise than I seem to run into problems with it.

  12. #12
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by psalzer
    You may be right. It's not complex..type anyway...if you use fixed font sizes. If you object to that concept it isn't all that simple to get everything to display in a way that makes sense in all standards compliant browsers. At least people with more expertise than I seem to run into problems with it.
    small-medium-large work fine for relative font sizes
    So do pt. I don't use px in any setup I do. And it works fine.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  13. #13
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by ddc
    <font> <b> <i> <u> are depricated in xhtml 1.0 transitional, and not allowed in any higher version or the strict version. Rather use <strong> <em> <div> <span> <p> for these kind of things.
    The <b> and <i> tags are still valid in xhtml 1.0, even in xhtml 1.0 strict.

    Extensible HTML version 1.0 Strict DTD
    <!ELEMENT i %Inline;> <!-- italic font -->
    <!ATTLIST i %attrs;>

    <!ELEMENT b %Inline;> <!-- bold font -->
    <!ATTLIST b %attrs;>
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd


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
  •