tags:

views:

43

answers:

3

I have the code, as below. It's a bit annoying to have the text not align (it affects other li elements). How can I make it a fixed-width? I've tried width=XYZpx but that did nothing.

<li class="date">2/28/2010 9:37:38 AM</li>
...
<li class="date">3/1/2010 9:37:38 AM</li>

css

li.date
{ 
  background : url(/icons/date.png) no-repeat left top;
}
A: 

I can't quite work through your grammar, but I think all you want is this, right?

li.date
{
  background : url(/icons/date.png) no-repeat left top;
  width: 200px; /* or whatever */
}
Matchu
+1  A: 

I think you need to set the width of the list for the <ul> element instead of the <li> element. If the list is contained inside of a <div>, you could set the width of the <div> instead of the <ul>, I believe.

ul {
   width: 125px;
}
gmcalab
+1  A: 
David Thomas
I think you understood correctly. Yes i didnt actually write = and use XYZ as my value. I wrote width: 2000px; in my css file as a test with no apparent changes. It appears i cant change the width of one li, i may need to change all or none. I tried using a div inside a li and wrote `li.date div{ display: inline; border-color: Black; color:Red; border-style:solid; border-width:5px; padding 5,5,5,5;}` The pading and with did nothing (at least in FireFox). This code originally use a ul i think i should change it to use divs instead.
acidzombie24