<ul> <li>item1</li> <li>item1</li> <li>item1</li> <li>item1</li> <li>item1</li> <li>item1</li> </ul>
Suppose each block has a width of 150px , so the total width for the row is 450px . I try to make the list automatically allow only 3 fields (list items) in each line, and not force them to go under each other.
I tried something, not just asking before trying!
There is my attempt:
<div class="container"> <ul> <li>hreyyy</li> <li>hreyyy</li> <li>hreyyy</li> <li>hreyyy</li> <li>hreyyy</li> <li>hreyyy</li> </ul> </div> .container { width: 450px; } .container ul li { width: 150px; height: 100px; background-color: red; float: left; } .container ul { display: inline; }
Result:

(source: gyazo.com )
It doesnβt work as I wanted, why?
Is there a plugin for him that makes life easier?
html css
Jony kale
source share