473,473 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to set font within a ul table?

2 New Member
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
2 7591
drhowarddrfine
7,435 Recognized Expert Expert
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
paleopete
2 New Member
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

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

Similar topics

6
by: Csaba2000 | last post by:
How do I detect when the font size has been changed (especially by user action: either Ctrl+Scroll wheel or View/Text Size)? This is just for use on IE 5.5+, but it would be great if there was a...
7
by: Jon | last post by:
Hi, I have table text set to 85%, I may change that to em's but for now haven't If I have a table nested within the table I get font size of 85% of 85% = 72% - too small. Without...
2
by: Isaac Grover | last post by:
Hi everyone, Rather than have this construct in my pages: <table> <tr><td><font face=arial size=3>line1</font></td></tr> <tr><td><font face=arial size=3>line2</font></td></tr> <tr><td><font...
115
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." ...
16
by: Coder Droid | last post by:
I'm trying my first table-less site, and I've bumped my head up against a wall. I can't change the font size within a div. Real quick, my style sheet has: -------------------------------------...
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
2
by: Dave Moore | last post by:
Hi, I want to use CSS to define the font size in every cell of a table. This avoids needing to define the font size in every <TD> tag using the normal multiple HTML <FONT SIZE="2"> notation....
0
by: Coleen | last post by:
HI All :-) I don't know if I will be able to do this type of formatting, but what I need to do is have a table row where the text wraps (This is easy) the first line of text is font size 10 pt...
3
by: =?Utf-8?B?dG9t?= | last post by:
Hi All, I have a theme with a Style.css in which I have defined a style rule for the body element : body { min-width: 780px; margin: 0; padding: 0;
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.