I'm making a responsive list with floated <li>
's, where I want the list to stay with three columns. However, when resizing the window the floated items are pushed – as with fixed items – into two columns, instead of resizing. Here's an example of my code:
#list {
position: relative;
width: 100%;
display: block;
}
#list li {
position: relative;
width: 27%;
float: left;
margin: 2% 2% 0 0;
display: block;
}
<ul id="list">
<li>item1</li>
<li>item1</li>
<li>item1</li>
<li>item1</li>
<li>item1</li>
<li>item1</li>
<ul>