6 ms·
I built a masonry layout with only CSS and HTML 10 years ago. The site is actually still live. A scripting language is used to generate the HTML and CSS based o
by codingclaws 2y ago
I built a masonry layout with only CSS and HTML 10 years ago. The site is actually still live. A scripting language is used to generate the HTML and CSS based on the dimensions of the images. But the masonry runs left to right not top to bottom.
- thejohnconway 2y agoHow does that differ from just setting the images to be inline-blocks? Was it justified?
- codingclaws 2y agoIt's centered basically. All rows span the same width, but the heights of the rows can differ.
- The_Colonel 2y agoThat's not going to be responsive which is today a must have.
- codingclaws 2y agoIt is actually responsive, I think because I used percentages in the CSS.
- The_Colonel 2y agoSo it makes pictures larger / smaller based on the screen width? Usually what is expected is that with narrower screen, you get fewer columns, pictures are still same-ish size. You also need to keep the order of the items (e.g. on a wider screen 1, 2, 3, 4 are all on one row, with a smaller screen 1 and 2 are on a row, then 3 and 4 on another row).
- CodeWriter23 2y agoSo no different than current design paradigms (which I loathe btw) which give you the exact same content regardless of viewport size.
- The_Colonel 2y agoSure, but different from what the masonry design is meant to facilitate (check the linked demos). It's very useful esp. for a photo gallery kind of sites.