CSS Floats & Collapsing White Space

I have a page created by a database. It creates a DIV for each record (extremely simplified for the sake of the question). Each of these DIVs has a given width and floats to the left.

However, these DIVs do not have a given height, so sometimes the following happens, as shown in the figure. Is there a good way to prevent this, and is white space just “collapsing”?

Link to the site prototype. Here

+3
source share
6 answers
+4
source

, , clear: left; .

, , " " , Brynwood Pak N .

, "Brynwood Pak N Ship" , , " " , "- ".

clear: left , , "" . , ; "Brynwood Pak N Ship" "Postal Shoppe", . , , , .

+2

clear: left div. display: inline-block , , ( , IE 6 ), , , .

+1

. , !

+1

, CSS. , "display: inline-block" . , , .

"", , . , , , , . , 1, 2. ( ) 2, , , 1.

- , CSS ( , ). , Javascript. , , Javascript CSS-, Javascript , .

, . , , , , , , .

0

, flex-direction count-count:

.parent {
    column-count: 2;
    column-gap: 1.25rem;
}
.child-class {
    flex-direction: column;
    display: inline-block;
    width: 100%;
}

, , css.

0
source

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


All Articles