To create a responsive image mosaic:
- Use the
display: gridproperty to create a responsive layout. - Use
grid-row: span 2 / autoandgrid-column: span 2 / autoto create items that span two rows or two columns respectively. - Put
grid-rowandgrid-columnstyles in the media query to avoid applying them on small screens.
Bonus Tip:
-
loading='lazy'attribute is used to make images load lazily — only when they are in the user's field of vision.
Do you have a question ping me via Twitter
Top comments (0)