what is the XHTML equivalent of <font>?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    what is the XHTML equivalent of <font>?

    n/t
  • daemon
    Senior Member
    • Jun 2003
    • 2351
    • 3.5.x

    #2
    There is no <font> tag, but rather a tag called <span>.

    To style it, you use <span style=""> (it take the same elements as standard CSS).

    So, just stick CSS styling elements in and you'll get the equivalent.

    Here are the two CSS models (W3C standards):


    Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

    Comment

    • diades
      Senior Member
      • Jul 2002
      • 291
      • 3.5.x

      #3
      As daemon stated, the <font> tag has been deprecated. The replacement is using css font or the constituent attributes of it such as font-family These, in xhtml, can be used on pretty-well any element's style.
      Later
      Keith

      Webxpertz Community for Webmasters & Developers

      Comment

      • CeleronXT
        Senior Member
        • Mar 2002
        • 3217

        #4
        To expand on that and make it simple without having to read any lengthy W3 pages, if you want to do inline (even though inline isn't really that great) font styling, you can simply do this:

        <span style="font-family: verdana,sans-serif; size: 12px; color: #000000;">Stuff</span>

        You can, of course, leave out any of the attributes you don't need, like color/size.

        <span style="font-family: verdana,sans-serif; size: 12px;">Stuff</span>
        <span style="font-family: verdana,sans-serif; color: #000000">Stuff</span>
        <span style="font-family: verdana,sans-serif;">Stuff</span>
        "63,000 bugs in the code, 63,000 bugs, you get 1 whacked with a service pack, now there's 63,005 bugs in the code."
        "Before you critisize someone, walk a mile in their shoes. That way, when you critisize them, you're a mile away and you have their shoes."
        Utopia Software - Current Software: Utopia News Pro (news management system)

        Comment

        • Shining Arcanine
          Senior Member
          • Feb 2003
          • 2482
          • 3.0.3

          #5
          Don't use font tags, use css classes.

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #6
            CSS classes don't stand alone. You need some kind of tag to use the CSS class. That was what my question was about.

            In my case I am creating custom titles for my vB3 groups and I want to know what tag I should use in the custom title field besides font. There is no reason for me to use classes for my titles since each title is the only instance of that particular style.

            Comment

            • the Sandman
              Senior Member
              • Jul 2003
              • 1539
              • 3.7.x

              #7
              Here's what we're using for our Admin Titles - it works fine, but is it considered "correct"?
              HTML Code:
              <span style="color:darkblue" title="Administrator"><i><b>Username</b></i></span>
              The Admin Zone - Resources for Forum Administrators
              Articles - Forum Review
              Interviews:
              KierScottJerryAndreasSteveWayneJakeFlorisLogicianErwin
              Paul M

              Comment

              • Stadler
                Senior Member
                • Oct 2001
                • 1021
                • 4.2.X

                #8
                Well, you 'can' use the font-tag in XHTML, except in XHTML-strict. It's not forbidden there, but using <span ... + CSS-fomatting is the better choice anyway.
                Hints & Tips:
                [[vB3] More Spiders / Indexers / Archives for vB3 - list]|[List of one-time-emails to ban]


                http://sfx-images.mozilla.org/affili...efox_80x15.png

                Comment

                • diades
                  Senior Member
                  • Jul 2002
                  • 291
                  • 3.5.x

                  #9
                  CSS classes don't stand alone. You need some kind of tag to use the CSS class. That was what my question was about.
                  Hi jake
                  Not, strictly. You can have:
                  HTML Code:
                      <style type="text/css">
                      /*<![CDATA[*/
                        /* This class will be available to whichever tag that you 
                           wish to declare the class attribute for*/
                        .clsRed{color:#ff0000; background-color:transparent}
                        /* This class will be available to tags fo type span only that you
                           wish to declare the class attribute for*/
                        span.clsBlue{color:#0000ff; background-color:transparent}
                      /*]]>*/ 
                      </style>
                  So, to some extent, you can have an "open" class and use it wherever you wish.

                  Sandman:
                  <span style="color:darkblue" title="Administrator"><i><b>Username</b></i></span>
                  would be better written:
                  <span style="color:darkblue;font-style:italic; font-weight:bold;" title="Administrator">Username</span>

                  even better, of course, as a class:
                  HTML Code:
                      <style type="text/css">
                      /*<![CDATA[*/
                        .admin{color:darkblue;font-style:italic; font-weight:bold;}
                      /*]]>*/ 
                      </style>
                  ....
                  <span class="admin" title="Administrator">Username</span>
                  hth
                  Later
                  Keith

                  Webxpertz Community for Webmasters & Developers

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...