I want to center my webpage, and center the content on my web page, but the justify content (in css) does not seem to work. I have tried setting max-width in both precentage and pixels, and added and removed margins. I would really apreciate all help!
i have multiple div elements inside other elements, including a menu, which i would like to center, and even distrubetly the text inside the menu. Then i have an header which have a fixed size due to poor resolution. The only way i have managed to center anything is by setting margin to auto, but i believe that overwrites the flexbox system? I also tried creating a new div wich incapsulates everything (Innpakning1), but that only gave me two divs wich did not do what i hoped for.
<div class="innpakning1">
<div class="innpakning">
<div class="overskrift">
<img src="media/header.png" id='overskrift' alt="">
</div>
<div class="meny">
<div class="delmeny"> <a href="beisthjem.php" >Hjem</a> </div>
<div class="delmeny"> <a href="beistallebeist.php"> Alle beist</a> </div>
<div class="delmeny"> <a href="beistkategorier.php"> Kategorier </a> </div>
</div>
<div class="informasjon">
<p> Scamander har som sitt oppdrag i livet å finne og katogerisere beist. Han ønsker å vise verden at de er mer fantastiske enn farlige,
og har derfor laget denne siden som drives av en nonprofit organisasjon av samme navn som grunnleggeren. Her kan du kartelgge hvilke dyr som finens,
og gitt at du er en sertifisert beistfinner, legge til dine egne funn.
Vi gleder oss til å samarbeide med deg.
</p>
</div>
</div>
</div>
here is my css.
body{
display: flex;
background-color: blue;
width: 100%;
}
.innpakning1{
display: flex;
justify-content: center;
max-width: 800px;
margin-left: 15px;
}
.innpakning{
display: flex;
margin-left: 15px;
flex-direction: column;
background-color: red;
max-width: 400px;
justify-content: center;
}
.meny{
display: flex;
background-color: violet;
max-width: 200px;
justify-content: center;
margin-left: 15px;
}
.delmeny{
max-width: 200px;
display: flex;
margin-left: 15px;
}
#overskrift{
margin: auto;
display: flex;
height: 78px;
width: 317px;
margin-left: 15px;
}
.informasjon{
background-color: aliceblue;
display: flex;
max-width: 200px;
flex-direction: column;
justify-content: center;
margin-left: 15px;
}