Div Hintergrundfarbe erstreckt sich nicht auf untergeordnete Divs
Ich habe ein Container-Div mit mehreren untergeordneten Divs. Das übergeordnete Div hat eine Hintergrundfarbe, dies scheint sich jedoch nicht auf die letzten untergeordneten Divs zu erstrecken. Bitte siehe Code unten:
http: //codepen.io/tombarton/pen/aNaGG
<div class="container">
<ul>
<li>
...
</li>
</ul>
<hr>
<div class="checkout">
<div class="left">
...
</div>
<div class="right">
<div class="button">
...
</div>
</div>
</div>
</div>
CSS
body {
background-color: #F8F8F8;
font-family: 'Open Sans', sans-serif;
text-transform: uppercase;
}
.container {
display: block;
max-width: 600px;
height: 100%;
margin: 20vh auto;
padding: 0 3%;
background-color: white;
text-align: justify;
}
ul {
margin: 0;
padding: 0;
}
li {
position: relative;
list-style-type: none;
margin: 20px auto;
}
.checkout {
display: block;
margin-top: 10px;
width: 50%;
float: right;
}
.left {
display: block;
width: 55%;
float: left;
line-height: 40px;
text-align: right;
}
.right {
display: block;
width: 40%;
margin: auto;
float: right;
cursor: pointer;
}
Ich vermute, das liegt an der Tatsache, dass die letzten beiden Divs keinen Inhalt haben, aber ich bin nicht 100% sicher. Hat jemand irgendwelche Ideen?
Vielen Dank