6
- I am extremely new to the subject and do not know much, I am going from searches on the internet, videos and readings, I say this in case there is some code or unnecessary rule in my doubts
I would like some help in this situation:
I’m training some layout for a website where I sketched on the Illustrator:
When I went to start passing this to html and css I had problems aligning all the Divs on top of each other.
When on small screen the Ivs align, but when I stretch the browser screen each follows a different rule.
I had to join the two images to post, separated by the red bar:
Well, the question is this:, How do I align these Ivs ?
In the middle of the project I wondered if this is the best way to draw this layout. The brown banners are just to put an identifier with an icone and generate link like for example Contact, About, portfolio, things like that.
When I put one div inside the other, in this case, the brown buttons inside the blue column, it worked, but I’d really like that spaced between them, effect I couldn’t do with one div inside the other.
A bonus question, I tried to make my " Container " look like the draft image, where the top of it is not in the size 100% leaving the buttons above it. When I did this everything went wrong, I came next using the position rules but when I lowered the browser screen the buttons entered inside the other Ivs, I tried to do by float and did not get well, the rules did not answer anything.
Thank you in advance!
/* Estilo das colunas */
/* CABEÇALHO */
#cabecalho {
background-color: white;
height: 11em;
width: 100%;
}
#cabecalho > p {
text-align: center;
padding-top: 5em;
}
/* CONTAINER */
#container {
display: flex;
justify-content: center;
flex-direction: row;
flex-wrap: wrap;
}
/* COLUNAS */
.coluna {
margin: 4px;
width: 19em;
height: 33em;
background-color: lightblue;
border-radius: 10px;
}
/* BOTÕES */
.botao {
width: 19em;
border-radius: 10px;
height: 3.4em;
background-color: tan;
}
<!DOCTYPE HTML>
<html>
<head>
<title>Layout Menu.</title>
<link rel="stylesheet" href="estilo.css">
<link rel="stylesheet" href="normalize.css">
</head>
<body>
<header id="cabecalho">
<P> LOGO </P>
</header>
<div id="container">
<section class="botao esquerdabotao">Menu</section>
<section class="coluna esquerdacoluna">
<p> Olá, aqui será feito os testes de escritas para o layout </p>
</section>
<section class="botao centralbotao">Menu</section>
<section class="coluna centralcoluna">
<p> Olá, aqui será feito os testes de escritas para o layout </p>
</section>
<section class="botao direitabotao">Menu</section>
<section class="coluna direitacoluna">
<p> Olá, aqui será feito os testes de escritas para o layout </p>
</section>
</div>
</body>
</html>
Face beforehand, give a read on this, flexbox, will help you solve most of these problems very quietly. https://css-tricks.com/snippets/css/a-guide-to-flexbox/
– Wagner araujo