How to leave the internal elements of a Section with two columns

Asked

Viewed 46 times

0

How to leave the internal elements of a section with two columns independent of browser size?

This image below is what I have ready. But as you can see it has four columns. I need you to have only two columns in each row, regardless of browser width.

inserir a descrição da imagem aqui

HTML and CSS

section.destaquestutisticos{
  float: left;
  width: 100%;
  max-width: 885px;
  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>Pontos turísticos</h1>

  <figure class="destaquestutisticos_comidastipicas">
      <a href="#" target="_blank">
      <img src="./imagens/comidastipicas.png" width="200" height="150" title="Comidas típicas">
      <figcaption>Comidas típicas</figcaption>
      </a>
  </figure>

  <figure class="destaquestutisticos_comidastipicas">
      <a href="#" target="_blank">
      <img src="./imagens/parques.png" width="200" height="150" title="Parques">
      <figcaption>Parques</figcaption>
      </a>
  </figure>

  <figure class="destaquestutisticos_comidastipicas">
      <a href="#" target="_blank">
      <img src="./imagens/praias.png" width="200" height="150" title="Praias de Guarapari">
      <figcaption>Praias</figcaption>
      </a>
  </figure>

  <figure class="destaquestutisticos_comidastipicas">
      <a href="#" target="_blank">
      <img src="./imagens/turismorural.png" width="200" height="150" title="Turismo rural">
      <figcaption>Turismo rural</figcaption>
      </a>
  </figure>

</section>

  • appears to me with 2 columns

  • in mobile stays only one

1 answer

0

I changed the CSS but don’t know what the reality of its interface, so change the width if the change is acceptable for what you need.

<style>
section.destaquestutisticos {
  float: left;
  width: 100%;
  max-width: 885px;
  height: auto;
  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 {
  height: 150px;
  font-size: 16px;
  text-transform: uppercase;
  display: inline-block;
}

figure.destaquestutisticos_comidastipicas a {
  text-decoration: none;
  text-align: center;
  color: #222222;
}

@media only screen and (max-width: 600px) {
    figure.destaquestutisticos_comidastipicas img {
      width: 150px;
    }
}
<style>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.