Add white-space: nowrap;
to the containing ul
and change the display of children li
s to
inline-block;
.
Demo http://jsfiddle.net/5CadG/
#list {
white-space: nowrap;
}
.tree li {
/* float: left; */ /* REMOVD */
display: inline-block;
/* rest of your styles */
}