www.webdeveloper.com
Results 1 to 6 of 6

Thread: <font size="2"> <span style="font-size:84%/1.2em">

  1. #1
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887

    <font size="2"> <span style="font-size:84%/1.2em">

    I know the FONT tag is depreciated and I hate using it when compaired to the SPAN tag and CSS.
    However, I always find myself correting others to use the SPAN tag and CSS instead of their FONT tags.
    When I find close but not exact replacements, they insist upon the FONT tag...
    From yahoo.com, I learned how to replace font size="2" with the correct font-size.
    Code:
    <font size="2">
    Code:
    <span style="font-size:84%/1.2em">
    Now, what if the font size is "3", what would it look like using a SPAN tag and CSS?

  2. #2
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Unfortunately, <font size="2"> is always the same size, no matter where you use it. <span style="font-size:84%/1.2em"> is not.
    Every fight is a food fight when you’re a cannibal.

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,222
    <span style="font-size: small"> is the same as <font size="2">.
    Code:
    size    font-size
    ----    ---------
      1     xx-small
    [n/a]   x-small
      2     small
      3     medium
      4     large
      5     x-large
      6     xx-large
      7     [n/a]
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887
    My bad, I meant <font size="3"> not <font size="2">

    Here, try this in IE and Firefox:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <title></title>
    <style type="text/css">
    body {background-color: #CCCCCC; color:black; font-family:verdana,arial,sans-serif;}
    </style>
    </head>
    <body>
    <div style="font-size:84%/1.2em;">These texts should be the same size.</div>
    <p><font size="3">These texts should be the same size.</font></p>
    </body>
    </html>

  5. #5
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887
    Quote Originally Posted by NogDog
    <span style="font-size: small"> is the same as <font size="2">.
    Code:
    size    font-size
    ----    ---------
      1     xx-small
    [n/a]   x-small
      2     small
      3     medium
      4     large
      5     x-large
      6     xx-large
      7     [n/a]
    Awesome, thanks NogDog! I won't stand up for another FONT tag again!
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    	"http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <title></title>
    <style type="text/css">
    body {background-color: #CCCCCC; color:black; font-family:verdana,arial,sans-serif;}
    </style>
    </head>
    <body>
    <p><span style="font-size:medium;">These texts should be the same size.</span></p>
    <p><font size="3">These texts should be the same size.</font></p>
    </body>
    </html>

  6. #6
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    What are you using <span> for when you have a perfectly good <p> sitting right there?
    Every fight is a food fight when you’re a cannibal.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles