...">

CSS: arrange groups of similar elements in two columns

If my HTML says something like the following

<div class="container"> <div class="element"> </div> <div class="element"> </div> [...] <div class="element"> </div> </div> 

Is it possible to align these elements as if they were in a table with two columns? That is, with 7 elements there will be 4 lines, with the last line having only one element.

(The elements themselves do not have special classes or identifiers, such as right, left, etc.)

+4
source share
1 answer

Yes:

 .container{ position: relative } .element{ width: 50%; float: left } 
+13
source

Source: https://habr.com/ru/post/1310329/


All Articles