Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Div's with different heights, align them side by side at the top

Tags:

css

I want to align divs side by side, but the heights are not equal, which causes that there is a blank space between div's the first line with lower height and the div's in the second row.

I want this:

and not this:

like image 526
Giest Avatar asked Nov 27 '22 09:11

Giest


1 Answers

I would use 3 divs (lets call them A B and C) as columns

These would have style="float:left;width:32%;" * note width CAN be less than 32% and can be set in px

A would contain 1 and 4 while B would contain 2 and 5. Finally C would contain 3 and 6.

There is absolutely no need for plugins and it can (and is currently, by me) being done with css alone.

like image 126
user314321 Avatar answered Nov 29 '22 02:11

user314321