Thanks for the responses. I'm not sure if I made it clear what my goal
was. The problem I'm using li elements
as buttons to trigger some event. The problem, however, is that when I
do this, clicking anywhere on the line
containing the list item will trigger the event. I want it to only be
triggered when the text is clicked. One solution
would be to wrap the text in anchor tags, but I would rather use the
list items directly if possible.
Keith
On Aug 21, 7:20 pm, "David E. Ross" <nob...@nowhere.notwrote:
Quote:
On 8/21/2008 12:18 PM, Keith Hughitt wrote:
>
>
>
>
Quote:
If you have a list:
>
Quote:
<ul>
<li>item 1 is short.</li>
<li>item 2 is a little bit longer</li>
</ul>
>
Quote:
regardless of the size of the contents of each list item, the element
will span the entire width of the UL
container.
>
Quote:
Anyone know how I can get the list items to only take up as much space
as their content requires?
>
>
What would you put into the unused space?
>
Each list item starts a new line. The line is only as long as its
content. I have an example of a page (at
<http://www.rossde.com/retired.html>) where there are block elements to
the right of list items (or parts thereof) within a UL element, and the
list items do not encroach into the blocks. The same page has a block
element to the left of a part of a list item, and the list item wraps
around to the right of the block. Therefore, I don't see a fixed width
for the UL element.
>
--
>
David E. Ross
<http://www.rossde.com/>
>
Q: What's a President Bush cocktail?
A: Business on the rocks.