<!DOCTYPE html>
<style>
.a {
margin: auto;
overflow: auto;
width: 200px;
}
.b {
height: 150px;
float: left;
width: 150px;
}
.g {
background-color: green;
}
.r {
background-color: red;
}
</style>
<div class="a">
<div class="b g"></div>
<div class="b r"></div>
</div>