...

View Full Version : Specifying the font in a list...



mccdaddy
06-24-2006, 06:22 AM
I'm updating an old site I hand-coded in basic HTML with CSS. I have an unordered list preceded with font tags for Verdana. However, I can find no information on adding a font attribute to a list in CSS. I tried putting the <p> tag before and after the <ul> tag and nothing works. I've been Googling for an hour and I've found every conceivable attribute I can add to a <ul> tag except the font. Either this is so simple that no one bothers writing about it, which means I'm an idiot, or it's too complicated to be addressed.

I suspect it's the former.

mccd

_Aerospace_Eng_
06-24-2006, 06:34 AM
Its actually pretty simple.

<style type="text/css">
ul {
font-family:Verdana, Tahoma, sans-serif;
}
</style>
I used multiple fonts because some users may not have a font listed, which case it defaults to some sans-serif font.

majo
06-24-2006, 06:38 AM
if you don't mind inline styles, try:

<ul style="font-family: Verdana;">
<li>testing</li>
<li>testing2</li>
</ul>
If you only wanted to style one of your list items, then:

<ul>
<li style="font-family: Verdana;">testing</li>
<li>testing2</li>
</ul>
If you want all your lists to look the same, then place this somewhere in your <head> section:
<style type="text/css">

ul {
font-family: Verdana;
}

</style>
and just use your tags normally.
(eg)

<ul>
<li>testing</li>
<li>testing2</li>
</ul>

majo
06-24-2006, 06:38 AM
hee hee _Aerospace was off the launch pad before me :p

mccdaddy
06-24-2006, 06:47 AM
I was right; I'm an idiot :rolleyes: I knew it had to be something simple.

Thank you so much.

mccd



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum