Auto fit width of li to text?

css, javascript

Solution

As @willoller already said, the li element is a block level element, but apart from floating it, you can also use:

li {
    display: inline;
}

Problem

Is there anyway possible to auto fit the width of an <li> tag to the width of the text it contains using CSS? I'm designing a website that uses a custom CMS (and I don't have access to the code), so I'm limited in options as far as design goes. Javascript solutions that would work on an <li> tag without having to edit any of the list properties directly would work as well.

Original source