I have a list like this:
<div>
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
<li>four</li>
</ul>
</div>
and the following CSS:
ul {
width: 160px;
height: 100px;
overflow: auto;
}
li {
width: 80px;
display: inline-block;
float: left
}
I'm trying to force the list items to display from left to right, that is
one - two - three - four
My problem:
Doing it like this gives me two rows with two items each.
Question:
Is there a CSS way to force the list items to all be in a single row so I can use horizontal scrolling? Right now if I set overflow:auto I'm only getting vertical scrollbars, which I don't want.
I don't want to set this on the wrapping div. I'm just curious if there is a CSS solution I can use within the list alone.
Thanks for help!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…