<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/styles.css">
<title>Document</title>
</head>
<body>
<div class="container">
<div class="box">
<div class="dream">
<figure class="gallery__item gallery__item--1">
<img src="/images/1.jpg" alt="Gallery image 1" class="gallery__img">
<figure class="gallery__item gallery__item--2">
<img src="/images/2.jpg" alt="Gallery image 2" class="gallery__img">
</figure>
<figure class="gallery__item gallery__item--3">
<img src="/images/3.jpg" alt="Gallery image 3" class="gallery__img">
</figure>
<figure class="gallery__item gallery__item--4">
<img src="/images/4.jpg" alt="Gallery image 4" class="gallery__img">
</figure>
<figure class="gallery__item gallery__item--5">
<img src="/images/5.jpg" alt="Gallery image 5" class="gallery__img">
</figure>
</div>
<div class="dream">
<figure class="gallery__item gallery__item--6">
<img src="images/6.jpg" alt="Gallery image 6" class="gallery__img">
</figure>
<figure class="gallery__item gallery__item--7">
<img src="images/7.jpg" alt="Gallery image 7" class="gallery__img">
</figure>
<figure class="gallery__item gallery__item--8">
<img src="images/8.jpg" alt="Gallery image 8" class="gallery__img">
</figure>
<figure class="gallery__item gallery__item--9">
<img src="images/9.jpg" alt="Gallery image 9" class="gallery__img">
</figure>
</div>
</body>
</html>
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
object-fit: cover;
padding-top: 10px;
}
.container .box {
display: flex;
flex-direction: row;
justify-content: space-evenly;
}
.container .box .dream {
display: flex;
flex-direction: column;
width: 34%;
}
.container .box .dream img {
width: 100%;
padding-bottom: 5px;
}
@media only screen and (max-width: 769px) {
.container .box {
flex-direction: column;
}
.container .box .dream {
width: 25%;
}
}
@media only screen and (min-width: 1024px) {
.container {
display: grid;
width: 70%;
margin: 2rem auto;
}
.container .box {
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-template-rows: repeat(8, 5vw);
grid-gap: 1rem;
}
.gallery__img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.gallery__item--1 {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 3;
/** Alternative Syntax **/
/* grid-column: 1 / span 2; */
/* grid-row: 1 / span 2; */
}
.gallery__item--2 {
grid-column-start: 1;
grid-column-end: 3;
grid-row-start: 3;
grid-row-end: 5;
/** Alternative Syntax **/
/* grid-column: 3 / span 2; */
/* grid-row: 1 / span 2; */
}
.gallery__item--3 {
grid-column-start: 1;
grid-column-end: 3;
grid-row-start: 5;
grid-row-end: 7;
/** Alternative Syntax **/
/* grid-column: 5 / span 4;
grid-row: 1 / span 5; */
}
.gallery__item--4 {
grid-column-start: 1;
grid-column-end: 3;
grid-row-start: 7;
grid-row-end: 9;
/** Alternative Syntax **/
/* grid-column: 1 / span 4; */
/* grid-row: 3 / span 3; */
}
.gallery__item--5 {
grid-column-start: 3;
grid-column-end: 7;
grid-row-start: 1;
grid-row-end: 5;
/** Alternative Syntax **/
/* grid-column: 1 / span 4; */
/* grid-row: 6 / span 3; */
}
.gallery__item--6 {
grid-column-start: 3;
grid-column-end: 5;
grid-row-start: 7;
grid-row-end: 9;
/** Alternative Syntax **/
/* grid-column: 5 / span 4; */
/* grid-row: 6 / span 3; */
}
.gallery__item--7 {
grid-column-start: 3;
grid-column-end: 5;
grid-row-start: 5;
grid-row-end: 7;
}
.gallery__item--8 {
grid-column-start: 5;
grid-column-end: 7;
grid-row-start: 5;
grid-row-end: 7;
}
.gallery__item--9 {
grid-column-start: 5;
grid-column-end: 7;
grid-row-start: 7;
grid-row-end: 9;
}
}
I am unable to make the 3rd layout with grid for 1024px screens, I’ve been trying to solve this for more than 6 hours, can someone please help me with this, or send me the full source code of mosh. Thank you.