Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTML
- <body>
- <div class="gallery">
- <img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg" alt=v">
- <img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg" alt=v">
- <img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg" alt=v">
- <img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg" alt=v">
- <img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg" alt=v">
- <img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg" alt=v">
- </div>
- </body>
- CSS
- * {
- margin: 0;
- padding: 0;
- box-sizing:border-box;
- }
- .gallery {
- display:grid;
- /* grid-template-columns: repeat(auto-fit, 200px); */
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
- grid-column-gap: 15px;
- grid-row-gap: 15px;
- /* grid-template-rows: 100px 100px; */
- }
- .gallery img {
- width: 100%;
- }
Advertisement
Add Comment
Please, Sign In to add comment