SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast 2kool2's Avatar
    Join Date
    May 2001
    Location
    UK
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    line spacing in lists

    I'm having linespacing problems with unordered lists.

    When a list item goes over a single line I get very odd spacings between the lines. Is there a way of controlling this?

    Code:
    <style type="text/css">
    	a {font: 70%/100% Verdana,Helvetica,sans-serif;text-decoration:none; color:#000099}
    	a:hover{text-decoration:underline}
    	ul{line-height:90%}
    	div.box{width:145px}
    </style>
    
    <div class="box">
    	<ul>
    		<li><a href="">short link</a> </li>
    		<li><a href="">short link</a> </li>
    		<li><a href="">short link</a> </li>
    		<li><a href="">a longer link than usual which breaks over more than one line</a> </li>
    		<li><a href="">short link</a> </li>
    	</ul>
    </div>
    I've tried putting a div around the list item but to no avail. In the example above I added line height to the ul and that just makes thing worse.

    Any ideas?
    mike 2k: )2
    <work> http://webSemantics.co.uk </work>
    <rest> http://2kool2.com/ </rest>
    <play> http://bangersandmash.com/ </play>

  2. #2
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    Code:
    <style type="text/css">
    a { font-family: verdana, helvetica, sans-serif; font-size: 11px; text-decoration: none; color:#000099}
    a:hover { text-decoration: underline; }
    div.box { width: 145px; }
    ul {line-height: 100% }
    </style>
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  3. #3
    SitePoint Enthusiast 2kool2's Avatar
    Join Date
    May 2001
    Location
    UK
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    the line height stated in the <a> tag was definitely the problem.
    mike 2k: )2
    <work> http://webSemantics.co.uk </work>
    <rest> http://2kool2.com/ </rest>
    <play> http://bangersandmash.com/ </play>


Bookmarks

Posting Permissions

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