Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
16
rated 0 times [  18] [ 2]  / answers: 1 / hits: 36319  / 15 Years ago, thu, august 27, 2009, 12:00:00

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.


More From » css

 Answers
9

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



li {
display: inline;
}

[#98820] Sunday, August 23, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elishaannac

Total Points: 28
Total Questions: 97
Total Answers: 101

Location: Samoa
Member since Mon, Nov 8, 2021
3 Years ago
elishaannac questions
Sun, Dec 5, 21, 00:00, 3 Years ago
Mon, Jun 14, 21, 00:00, 3 Years ago
Mon, Jul 22, 19, 00:00, 5 Years ago
Mon, Jul 8, 19, 00:00, 5 Years ago
;