View Single Post
Old 02-07-2012, 09:13 PM   PM User | #1
dylanbaumannn
Regular Coder

 
Join Date: Feb 2012
Location: Nebraska, USA
Posts: 132
Thanks: 8
Thanked 19 Times in 19 Posts
dylanbaumannn is an unknown quantity at this point
Word-Wrapping on LI's

Hello!

QUESTION
I was wondering if it is possible to apply a sort of word-wrapping to an anchor tag that is inside of a List Item. I currently have a side navigation that is made out of an Unsorted List. List Items inside of this UL have a border-bottom applied to it so that it separates each item from the next one. My only problem is that the lengths of some of the anchor tags I have within the LI's are being word-wrapped in an odd manner, causing it to read:

Seward County Sherrif's
Posse"

instead of

Seward County
Sheriff's Posse

is there a way to set a word-wrap to the <a> tags so they wrap around after a certain width?

The HTML
Code:
<div id="subleftcolumn" class="grid_3 alpha">
        <ul>
               <li><a>Seward County Sheriff's Posse</a></li>
               <li><a>item 2</a></li>
               <li><a>item 3 is longer than the others</a></li>
               <li><a>item 4 is longer too</a></li>
       </ul>
</div> <!-- /leftcol -->
The CSS
Code:
#subleftcolumn{
	margin-top:125px;
	margin-left:25px;
	width:188px;
	}
#subleftcolumn ul{
	text-transform:uppercase;
	font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
	font-size:14px;
	color:#004f74;
	text-align:center;
	}
#subleftcolumn ul li{
	display:block;
	padding:3px 0;
	margin-left:0;
	border-bottom:1px solid #ead7a7;
	}
#subleftcolumn a{
	max-width:130px;
	line-height:110%;
	color:#043b54;
	text-decoration:none;
	}
Any help would be appreciated

Last edited by dylanbaumannn; 02-07-2012 at 09:33 PM..
dylanbaumannn is offline   Reply With Quote