I'm trying to build my first responsive layout. I want to display list items in a vertical line, depending on width.
<div style="height:800px;">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
</ul>
</div>
1 5 2 6 3 7 4
If the browser gets resized, I want it to become
1 4 7 2 5 3 6
Can someone help me? I've been trying for hours and I can't get anything. I've tried using tables but I can't do it like that either.