How to set font within a ul table?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paleopete
    New Member
    • Jan 2007
    • 2

    How to set font within a ul table?

    I'm a complete novice trying to write some xhtml 1.0 transitional script, so I apologize for asking such a simple-minded question.

    When trying to validate my page on w3c markup validator, I'm running into a error when making an unordered list. The script listed below passes validation - but I want it to display in the following font:

    <font face="Arial, Helvetica, sans-serif" size="2"></font>

    My question is where do I add this? Do I have to add the <font> element to each and every <li> line? Or is there a way to just specify the font style once for the entire list? I am opting for the latter, but that is where I am running into trouble in the markup validator.

    Thank you for your help!

    Pete

    Unordered List:

    <ul>
    <li>Division I
    <ul>
    <li>Mr. A, 3 dan, 4-0</li>
    <li>Mr. B, 3 dan</li>
    </ul>
    </li>
    <li>Division II
    <ul>
    <li>Mr. A, 3 dan, 4-0</li>
    <li>Mr. B, 3 dan</li>
    </ul>
    </li>
    <li>Division III
    <ul>
    <li>Mr. A, 3 dan, 4-0</li>
    <li>Mr. B, 3 dan</li>
    </ul>
    </li>
    </ul>
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    The <font> tag has been deprecated for years so you shouldn't use it. Also, your <li> and <ul> tags aren't quite matching up right.

    To do what you want, you need to use CSS. In the head, you can do this:

    <style type="text/css">

    li {font-family: Arial, Helvetica, sans-serif; font-size: 2em;}

    </style>

    EDIT: Disregard what I said above about the tags. They do match.

    Comment

    • paleopete
      New Member
      • Jan 2007
      • 2

      #3
      Originally posted by drhowarddrfine
      The <font> tag has been deprecated for years so you shouldn't use it. Also, your <li> and <ul> tags aren't quite matching up right.

      To do what you want, you need to use CSS. In the head, you can do this:

      <style type="text/css">

      li {font-family: Arial, Helvetica, sans-serif; font-size: 2em;}

      </style>

      EDIT: Disregard what I said above about the tags. They do match.
      Thank you very much for your help! That worked just as I'd hoped!

      Comment

      Working...