One way to fix this would be to wrap the divs in a container, and give that container a white-space:nowrap;text-align:center
rule. Then change the divs from floating to display:inline-block;
.
.box {
background-color: coral;
width: 30%;
display:inline-block;
margin:10px 0;
border-radius:5px;
}
.text {
padding: 10px 0;
color:white;
font-weight:bold;
text-align:center;
}
#container {
white-space:nowrap;
text-align:center;
}