How To Build A Magazine Layout With CSS Grid Areas — Smashing Magazine
In this article, I want to talk about the amazing possibilities of a CSS grid and how it allows for complex layouts that are closer to a print design. The design we’ll discuss is actually one I got to work on for a client (modified slightly to a demo case). It will cover two big use cases of a CSS grid:
- Having a static grid where we define the specified start and end points for each element;
- Using CSS grid template areas to reorder a simple HTML layout easily without updating the HTML.
As a bonus, we will also touch on object-fit and aspect-ratio, which come in handy as well.
Here you can see the design we will be implementing: desktop on the left and a cropped version for mobile on the right (imagine the mobile view to continue with sections 3 and 4). There is quite a lot going on here, and nothing really fits into neat rows and columns. The images are laid out on an uneven grid, sometimes even overlapping, and we have some narrow text and a numbering element that double as a design element.
Artisanal Image Layouts
Let us first look at the image grid elements inside each colored component. While we have four colored components, there are only two...
source: https://news.oneseocompany.com/2023/02/06/how-to-build-a-magazine-layout-with-css-grid-areas-smashing-magazine_2023020640288.html
Your content is great. However, if any of the content contained herein violates any rights of yours, including those of copyright, please contact us immediately by e-mail at media[@]kissrpr.com.