Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    65
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Specifying the font in a list...

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Its actually pretty simple.
    Code:
    <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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you don't mind inline styles, try:
    Code:
    <ul style="font-family: Verdana;">
    	<li>testing</li>
    	<li>testing2</li>
    </ul>
    If you only wanted to style one of your list items, then:
    Code:
    <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:
    Code:
    <style type="text/css">
    	
    	ul {
    		font-family: Verdana;
    		}
    	
    </style>
    and just use your tags normally.
    (eg)
    Code:
    <ul>
    	<li>testing</li>
    	<li>testing2</li>
    </ul>

  • #4
    New Coder
    Join Date
    Jun 2006
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hee hee _Aerospace was off the launch pad before me

  • #5
    New Coder
    Join Date
    Dec 2005
    Posts
    65
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I was right; I'm an idiot I knew it had to be something simple.

    Thank you so much.

    mccd


  •  

    Posting Permissions

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