- I am extremely new to the subject and do not know much, I'm going from internet searches, videos and readings, I say this in case there is any unnecessary code or rule in my doubts p>
I would like some help in this situation:
I'm training a layout for a website where I've sketched in illustrator:
WhenIstartedtomovethistoanhtmlandcssIgotproblemswithaligningallthedivsontopofeachother.
Whenonasmallscreenthedivslineup,butwhenIstretchthebrowserscreeneachonefollowsadifferentrule.
Ihadtoputtogetherthetwoimagestopost,separatedbytheredbar:
Well,thequestionis,HowdoIleavethesedivsinalignment?
InthemiddleoftheprojectIwaswonderingifthisisthebestwaytodrawthislayout.ThebrownbannersareonlyforbyanidentifierwithaniconandgeneratelinksuchasContact,About,Portfolio,thingslikethat.
WhenIputadivinsidetheotherone,inthecase,thebrownbuttonsinsidethebluecolumnworked,butI'dreallylikeittobespacedbetweenthem,whichIcouldnotdowithonedivinsideanother.Abonusquestion,Itriedtomakemy"Container" look like the sketch image, where the top is not 100% leaving the buttons above it. When I did this it all went wrong, I came around using the position rules but when I slowed the browser screen the buttons went inside the other divs, I tried to float and I did not get well, the rules did not respond at all.
/ li>
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>