To achieve the desired outcome for your design, it's important to consider various factors that can impact the final result. These factors include how you want the vertical stacked DIVs to interact and how you want the content of each DIV to affect their heights. A common approach to address this is through the use of media queries, where you can define specific break points (such as 2000, 1000, and 700) and adjust the widths of floating DIVs accordingly:
For a live demo, check out this link: http://codepen.io/anon/pen/gPKEax
Here's a snippet of the code:
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
* {box-sizing: border-box;}
div {
width: 100%;
float: left;
}
div:nth-child(even) {
background: red;
}
div:nth-child(odd) {
background: green;
}
@media (max-width: 2000px) {
div {
width: 25%;
}
}
@media (max-width: 1000px) {
div {
width: 50%;
}
}
@media (max-width: 700px) {
div {
width: 100%;
}
}