Ich verstehe immer noch nicht wirklich, wie man Divs zentriert. In dieser Geige können Sie sehen, dass ich die Divs zentriert habe, aber sie überlappen sich. Ich habe beide eingestellt, Inline-Block-Denken anzuzeigen, das es lösen würde, aber das hat nichts getan.Wie bekomme ich diese divs Stapel übereinander in der Mitte der Seite?
https://jsfiddle.net/fyu1sup0/1/
html, body {
font-family:;
margin:0 auto;
text-transform: lowercase;
font-family: Europa;
letter-spacing: 0.5px;
}
.container {
padding:0;
margin:0 auto;
}
.top {
background-color: blue;
position: absolute;
width: 300px;
height: 200px;
z-index: 15;
top: 50%;
left: 50%;
margin: -100px 0 0 -150px;
display:inline-block;
}
.top h1 {
width:100%;
font-size:50px;
color:#2CCDAD;
}
.bottom {
position: absolute;
width: 300px;
height: 200px;
z-index: 15;
top: 50%;
left: 50%;
margin: -100px 0 0 -150px;
display:inline-block;
}
.bottom h1 {
font-size:40px;
color:black;
width:100%;
}