Skip to content

Instantly share code, notes, and snippets.

@RomanMaksudov
Created February 5, 2024 14:03
Show Gist options
  • Save RomanMaksudov/6fa40ac4f9cc3aa26145aa0c1179b133 to your computer and use it in GitHub Desktop.
Save RomanMaksudov/6fa40ac4f9cc3aa26145aa0c1179b133 to your computer and use it in GitHub Desktop.
align-self_1
<h2>Галерея</h2>
<div class="gallery gallery-1">
<img src="img/photo-1.jpeg" alt="">
<img src="img/photo-2.jpeg" alt="">
<img src="img/photo-3.jpeg" alt="">
<img src="img/photo-4.jpeg" alt="">
<img src="img/photo-5.jpeg" alt="">
<img src="img/photo-6.jpeg" alt="">
<img src="img/photo-7.jpeg" alt="">
<img src="img/photo-8.jpeg" alt="">
<img src="img/photo-9.jpeg" alt="">
</div>
h2 {
margin: 0;
}
.gallery {
box-shadow: 5px 5px 10px grey;
padding: 20px;
margin-bottom: 20px;
min-height: 300px;
display: flex;
align-items: center;
}
.gallery > img {
width: 200px;
}
.gallery > img:nth-of-type(-n+3) {
align-self: flex-start;
}
.gallery > img:nth-of-type(n+7) {
align-self: flex-end;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment