By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,879 Members | 1,809 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,879 IT Pros & Developers. It's quick & easy.

How to set font within a ul table?

P: 2
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>
Jan 22 '07 #1
Share this Question
Share on Google+
2 Replies


drhowarddrfine
Expert 5K+
P: 7,435
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.
Jan 23 '07 #2

P: 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.
Thank you very much for your help! That worked just as I'd hoped!
Jan 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.