5
I have the situation below:
I need the 04 images to be distributed horizontally equally within the space bounded by section
, independent of the width of the browser. Not to be left empty as can be seen on the right.
I looked for several alternatives, but nothing reached the desired result.
section.destaquestutisticos{
float: left;
width: 100%;
max-width: 1200px;
height: auto;
margin-top: 10px;
border: 2px #FF8922 solid;
box-sizing: border-box;
}
section.destaquestutisticos h1{
font-size: 25px;
padding-left: 15px;
padding-top: 5px;
color: #FF8922;
}
figure.destaquestutisticos_comidastipicas{
float: left;
width: 200px;
height: 150px;
padding: 10px;
padding-bottom: 35px;
font-size: 16px;
}
figure.destaquestutisticos_comidastipicas a{
text-decoration: none;
text-align: center;
color:#222222;
}
figure.destaquestutisticos_comidastipicas{
text-transform: uppercase;
}
<section class="destaquestutisticos">
<h1>Destaques de Guarapari</h1>
<figure class="destaquestutisticos_comidastipicas">
<a href="comidas_tipicas.asp" title="Comidas típicas | Guarapari">
<img src="http://via.placeholder.com/200x150" width="200" height="150" title="Comidas típicas | Guarapari">
<figcaption>Comidas típicas</figcaption>
</a>
</figure>
<figure class="destaquestutisticos_comidastipicas">
<a href="parques.asp" title="Parques | Guarapari">
<img src="http://via.placeholder.com/200x150" width="200" height="150" title="Parques | Guarapari">
<figcaption>Parques</figcaption>
</a>
</figure>
<figure class="destaquestutisticos_comidastipicas">
<a href="praias.asp" title="Praias de Guarapari">
<img src="http://via.placeholder.com/200x150" width="200" height="150" title="Praias de Guarapari">
<figcaption>Praias</figcaption>
</a>
</figure>
<figure class="destaquestutisticos_comidastipicas">
<a href="turismo-rural-guarapari.asp" title="Turismo rural | Guarapari">
<img src="http://via.placeholder.com/200x150" width="200" height="150" title="Turismo rural | Guarapari">
<figcaption>Turismo rural</figcaption>
</a>
</figure>
</section>
Use "%" instead of "px" for increased responsiveness in browsers. This way the spacing will be equal regardless of browser or resolution.
– Paulo Sérgio Duff
@Paulosérgioduff didn’t work, then he breaks the line.
– Gladison
i would use flexbox. is the best way to organize items currently. study about.
– Leandro
This answer is equivalent https://answall.com/a/169088/3635, only replace <li> with figure.
– Guilherme Nascimento
Gladison, any answers for you? Or is it still an unanswered question?
– Bsalvo