I make a site with a news feed. And the view of this tape is now quite popular - the display of news in the form of blocks, "bricks" (picture + description).

I organized the following markup: A row of divs of the same width and height with CSS (float: left;) and at the end of this line br with CSS (clear: both;).

The customer suddenly found for himself that he needed the so-called endless scrolling. The question has matured, and very serious:

How can I optimize my layout for dynamic output from Mysql? I have been jumping from forum to forum for three days now and decided to write here. Please inspire :)

    1 answer 1

    Try using display: inline-block so that the block elements follow each other, and when the width of the parent changes, they fill this width with themselves (almost like a float). After this, adding news will not be so haemorrhagic.