I currently have the following code ...
<!DOCTYPE html> <html> <head> <title>Test</title> <meta charset="UTF-8" /> <link href="verna.css" type="text/css" rel="stylesheet" /> </head> <body> <section id="devices"> <h1>Gruppen</h1> <div class="group"> <h2>Gruppe 1</h2> <ul> <li class="device">Schalter 1</li> <li class="device">Schalter 2</li> <li class="device">Schalter 3</li> </ul> </div> <div class="group"> <h2>Gruppe 2</h2> <ul> <li class="device">Schalter 1</li> <li class="device">Schalter 2</li> <li class="device">Schalter 3</li> </ul> </div> </section> </body> </html>
* { margin: 0; padding: 0; } ul { list-style-type: none; } #devices { background-color: yellow; } #devices .group { background-color: gray; } #devices .group ul { text-align: center; } #devices .group .device { background-color: green; display: inline-block; margin: 5px; max-width: 200px; width: 100%; }
... which looks like this: 
But I want the green <li> elements to float in the columns. It should look like this: 
Please note: the number of green <li> elements is a variable, may be more or less than three elements, and may be more than two columns! I want to order <li> elements "column by column" and center them ...
Thanks for the help: -)
source share