2 replies [Last post]
seb
Offline
Enthusiast
Last seen: 14 years 44 weeks ago
Joined: 2003-09-20
Posts: 208
Points: 0

When floating list items left to create a horizontal menu, how do you "tidy the flow up". By this I mean ensure that the next element is going to appear below the menu type stuff.

At the moment I'm floating the containing element left and putting a clear:left on the next element.

<ul id="menu" style="float:left;">
  <li style="float:left;">blah</li>
  <li style="float:left;">blah</li>
  <li style="float:left;">blah</li>
</ul>

<div id="content" style="clear:left;"></div>

Better way of doing it, or is that the most correct method?

Root
Offline
Enthusiast
Brighton UK
Last seen: 14 years 43 weeks ago
Brighton UK
Joined: 2004-09-08
Posts: 76
Points: 0

Another float question

There is absolutely no need (thank heavens) to float list items. Either
display: inline and / or display: block in the parent container is quite enough. The heads up is to be found as always at Listamatic.

No class, little style and a lotta division.

seb
Offline
Enthusiast
Last seen: 14 years 44 weeks ago
Joined: 2003-09-20
Posts: 208
Points: 0

Another float question

Ah but I think there is when you want your <a> tags inside the <li> tags to be block-level elements?