Chris Bolton
Chris Bolton

Reputation: 2926

Overflowing a list horizontally

So I have an unordered list where I'm trying to have the li's overflow horizontally, but whenever they hit the boundary they just go below on a newline. Any suggestions on how to get around this?

Upvotes: 0

Views: 61

Answers (2)

bookcasey
bookcasey

Reputation: 40453

ul {
    white-space:nowrap;
}
li {
    display:inline;
}

Upvotes: 3

sandeep
sandeep

Reputation: 92803

You can use white-space property with display:inline-block like this:

ul {
 white-space:nowrap;
}
li {
 display:inline-block
 *display:inline;/* IE7 */
 *zoom:1;
 white-space:normal;
}

Upvotes: 1

Related Questions