I almost finish my website but I have one more issue,
At 745px the filter boxe is looking wrong.
I would like to have it like this
@media screen and (max-width: 768px) {
.bloc-filtres {
flex-direction: column;
}
.bloc-filtres ul {
display: flex;
gap: 1rem;
}
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<div class="bloc-filtres">
<p id="titre-filtre">Filtres</p>
<ul>
<li class="filtres">
<i class="fa-solid fa-money-bill-wave"></i>
<input type="checkbox" id="eco" name="filtre-possible" value="eco" />
<label for="eco">Économique</label>
</li>
<li class="filtres">
<i class="fa-solid fa-person"></i>
<input type="checkbox" id="famille" name="filtre-possible" value="famille" />
<label for="famille">Familial</label>
</li>
<li class="filtres">
<i class="fa-solid fa-heart"></i>
<input type="checkbox" id="romantique" name="filtre-possible" value="romantique" />
<label for="romantique">Romantique</label>
</li>
<li class="filtres">
<i class="fa-solid fa-dog"></i>
<input type="checkbox" id="animaux" name="filtre-possible" value="animaux" />
<label for="animaux">Animaux autorisés</label>
</li>
</ul>
</div>
2
Answers
Just add a few lines to your CSS rule:
Flexbox is great! But in this case i would prefer gridsystem. Why? Because you have already a fix structure and dont need the advantages from flexsystem (
flex!
). Below you can see a grid example.