How to put a SECTION next to each other?

Asked

Viewed 2,094 times

2

I can’t, every time I try to cut the baseboard or it goes up.

.principal {
  margin: 0 auto;
  background-color: #000000;
}
.bloco {
  height: 100%;
  width: 50%;
  padding: 5px;
  border-sizing: border-box;
  padding-bottom: 3%;
  float: left;
  background-color: #cccccc;
  clear: both;
}
<section class="principal">
  <section class="bloco">
    <h2>Bem Vindo</h2>
    <p>Neste site você encontra todos os meus trabalhos, de forma simples e organizada.</p>
  </section>

  <section class="bloco">
    <p>Neste site você encontra todos os meus trabalhos, de forma simples e organizada.</p>
  </section>
</section>

footer {
  background-color: #000000;
  color: #FFFFFF;
  font-family: Verdana;
  font-size: 14px;
  text-align: center;
  padding: 3px;
}
<footer>
  <p>Todos os direitos reservados. Desenvolvido por Thayna Menezes - © Copyright 2016.</p>
</footer>

That’s kind of how I want it.

What I have to change?

  • 1

    Post your code or what you tried, so it’s hard to help.

  • Managed to make ?

  • No, it’s not working, I’ll draw a picture of how I want

  • Also put footer code, HTML and CSS.

1 answer

1


.principal {
  background-color: #000000;
  height: 270px;
  width: 100%;
}

div.wrapper{
  position: relative;
  width: 80%;
  margin: auto;
}
.bloco {
  height: 230px;
  width: 45%;
  border-sizing: border-box;
  float: left;
  background-color: #cccccc;
  margin: 20px;
}

footer{
  text-align: center;
  background-color: red;
  color: #FFF;
  position: absolute;
  bottom: 0;
  line-height: 50px;
}
   <section class="principal">
<div class="wrapper">
  <section class="bloco">
<h2>Bem Vindo</h2>
<p>Neste site você encontra todos os meus trabalhos, de forma simples e organizada.</p>
  </section>

  <section class="bloco">
<p>Neste site você encontra todos os meus trabalhos, de forma simples e organizada.</p>
  </section>
  </div>
</section>

<footer>Rodapé</footer>

Browser other questions tagged

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