Answer the question
In order to leave comments, you need to log in
How to arrange list items in a row of two items?
there is an unordered list of six items. I need every third item inside the container to wrap to the next line. that is, you need to get three columns of two items. I lost my feet looking for something (
Answer the question
In order to leave comments, you need to log in
<style>
li { float: left; margin: 1em; }
li:nth-child(2n+1) { clear: both; }
</style>
<ul>
<li> 1
<li> 2
<li> 3
<li> 4
<li> 5
<li> 6
</ul>
If it is possible to edit the script, then assign a class to every fourth element, and that's it.
If it is not possible, then add a class to every fourth element of the list through js.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question