Forum Moderators: not2easy

Message Too Old, No Replies

spacing in unordered list wrapped text

         

lleemon

9:42 pm on Jun 14, 2007 (gmt 0)

10+ Year Member



I have a unordered list that I have added some styling. My issue dealing with then the list text wraps to the next line the spacing between the first sentence and second sentence is different. Is there a css way to adjust just this spacing and not the spacing between the the list items?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">


.sample {
width: 350px;
}
/*********** #head2 link styles ***********/
ul#head2 {
margin: 1em 0px 1em 0px;
padding: 1px 0px 13px 0px;
list-style-type:none;
color: #6c3;
font-family: Arial, Helvetica, sans-serif;
}

ul#head2 li {
display:block;
list-style-type:none;
line-height: 75%; /* css leading */
padding-left: 0em; /* for moving li to the right */
padding-top: 0.1em;
padding-bottom: 0.1em;
}

html>body ul#head2 li {
line-height: 85%; /* css leading */
padding-top: 0.08em;
padding-bottom: 0.08em;
}

ul#head2 li a {
display:block;
background:transparent url(../images/bullet_g.gif) no-repeat 0;
background-position: top left;
color: #6c3;
font-size: .9em;
font-weight: bold;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
line-height: 100%; /* css leading */
}

.indenttextonly {
margin-left: 1.2em;
}

html>body .indenttextonly {
margin-left: 1.3em;
line-height: 100%;
}

ul#head2 li a:hover {
background:transparent url(../images/bullet_o.gif) no-repeat 0;
background-position: top left;
color: #f63;
}

ul#head2 li#bullet2 a {
background:transparent url(../images/numbers/two_g.gif) no-repeat 0;
background-position: top left;
}

ul#head2 li#bullet2 a:hover {
background:transparent url(../images/numbers/two_o.gif) no-repeat 0;
background-position: top left;
color: #f63;
}


<div class="sample">
<ul id="head2">
<li><a href="#"><div class="indenttextonly">Design With Architects & Designers blah blah blah blah blah blah blah</div></a> </li>
<li><a href="#"><div class="indenttextonly">Design With Property Managers</div></a></li>
<li><a href="#"><div class="indenttextonly">A Turnkey Solution: An Atrium Remodel</div></a></li>
<li><a href="#"><div class="indenttextonly">Professional Affiliations</div></a></li>
</ul>
</div>

penders

10:17 am on Jun 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Setting the line-height on the li (which you are doing) will adjust the height of the lines (and hence the space between them) for text within the li. You would need to alter the margins of the li to effect the space between the li's themselves.

Is that what you are after?

lleemon

5:57 pm on Jun 15, 2007 (gmt 0)

10+ Year Member



penders, I will try it out. Thanks.

Xapti

3:58 am on Jun 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When dealing with ids you don't need to have the element#id notation, because ids are designed so that there's only one. because there's only one element on the entire page which has that id, it's redundant to specify which element it is.

display:block is default for a list item

padding-top and padding-bottom is also contributing to the situation. I would hope/assume that you knew that though. Margin was not specified though, so it's potentially possible the browser has a non-zero default value for it.

[edited by: Xapti at 4:03 am (utc) on June 17, 2007]