refactor: Style photo display

This commit is contained in:
moanos [he/him] 2024-03-20 14:04:51 +01:00
parent b0b5b185d6
commit f50d0ae873
2 changed files with 27 additions and 3 deletions

View File

@ -1,3 +1,8 @@
html, body {
margin: 0;
height: 100%;
}
.content-box { .content-box {
margin-top: 25px; margin-top: 25px;
} }
@ -321,4 +326,19 @@ h1 {
.card-rule { .card-rule {
width: 100%; width: 100%;
} }
}
.photos {
display: flex;
flex-wrap: wrap;
}
.card-photo {
flex: 1 16%;
margin: 10px;
}
.card-photo img {
max-width: 100%;
border-radius: 10%;
} }

View File

@ -18,7 +18,11 @@
</div> </div>
<p>{{ animal.description }}</p> <p>{{ animal.description }}</p>
<h2>Bilder</h2> <h2>Bilder</h2>
{% for image in animal.photos_list %} <div class="photos">
<img src="/media/{{ image.image }}"> {% for image in animal.photos_list %}
{% endfor %} <div class="card-photo">
<img src="/media/{{ image.image }}" alt="{{ image.alt_text }}">
</div>
{% endfor %}
</div>
</div> </div>