David Dorward <do*****@yahoo.com> wrote:
Is it possible to have 4 LI items in a <UL> with the LI width set to
width:25%
Sure it is. You need to change li to display: inline;
No, the moment you make them display: inline, the width property no longer
applies. You'll need to use float instead.
In cases like this, before suggesting to float an element it should imo
always be pointed out that the correct way to do this is to set display
to either inline-block or inline-table, and that resorting to floating
is a nasty hack which is sometimes needed because Mozilla and IE don't
support either css value [1].
Then it should be pointed out that using floats inappropriately like
this has drawbacks such as running into UA float bugs, floats being
removed from the flow and the necessity to use the clear property on the
next block level element (with more bugs).
The #1 problem people run into when using css for layouts is due to IE's
lack of support for css tables, the #2 problem is floats being used
inappropriately, the problems they cause which leads to people saying
that css isn't suitable for layouts.
[1] on block level elements
--
Spartanicus