Skip to content

Commit 11be225

Browse files
committed
Fix vertical space between projetcs on home page
1 parent bc86501 commit 11be225

File tree

2 files changed

+41
-13
lines changed

2 files changed

+41
-13
lines changed

assets/css/style.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,34 @@ footer p a i:hover {
4545
align-items: center;
4646
}
4747

48+
.flex-row {
49+
display: flex;
50+
flex-wrap: wrap;
51+
justify-content: space-between;
52+
gap: 20px;
53+
}
54+
55+
.flex-col {
56+
flex: 1 1 calc(33.333% - 20px); /* 3 colonnes avec un espace de 20px */
57+
max-width: calc(33.333% - 20px); /* Limite la largeur pour respecter la grille */
58+
box-sizing: border-box; /* Inclut le padding dans la largeur */
59+
}
60+
61+
@media (max-width: 768px) {
62+
.flex-col {
63+
flex: 1 1 calc(50% - 20px); /* 2 colonnes sur les écrans moyens */
64+
max-width: calc(50% - 20px);
65+
}
66+
}
67+
68+
@media (max-width: 576px) {
69+
.flex-col {
70+
flex: 1 1 100%; /* 1 colonne sur les petits écrans */
71+
max-width: 100%;
72+
}
73+
}
74+
75+
4876
.spot-tag {
4977
margin-right: 5px;
5078
padding: 4px 7px

base/templates/base/home.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212

1313
{% block content %}
1414
<div class="container-fluid bg-3 text-center">
15-
<div class="row">
16-
{% for projet in object_list %}
17-
{% if projet.actif %}
18-
<div class="col-md-4 col-sm-6 col-xs-12">
19-
<h3>
15+
<div class="flex-row">
16+
{% for projet in object_list %}
17+
{% if projet.actif %}
18+
<div class="flex-col">
19+
<h3>
20+
<a href="{{ projet.get_absolute_url }}"{% if projet.external %} target="_blank"{% endif %}>
21+
{{ projet.nom }}
22+
</a>
23+
</h3>
2024
<a href="{{ projet.get_absolute_url }}"{% if projet.external %} target="_blank"{% endif %}>
21-
{{ projet.nom }}
25+
<img src="{% if projet.image %}{{ projet.image.url }}{% endif %}" class="img-responsive projet" style="max-height: 300px; margin: auto" alt="{% trans "Project" %} {{ projet.nom }}">
2226
</a>
23-
</h3>
24-
<a href="{{ projet.get_absolute_url }}"{% if projet.external %} target="_blank"{% endif %}>
25-
<img src="{% if projet.image %}{{ projet.image.url }}{% endif %}" class="img-responsive projet" style="max-height: 300px; margin: auto" alt="{% trans "Project" %} {{ projet.nom }}">
26-
</a>
27-
</div>
28-
{% endif %}
29-
{% endfor %}
27+
</div>
28+
{% endif %}
29+
{% endfor %}
3030
</div>
3131
</div>
3232
{% endblock %}

0 commit comments

Comments
 (0)