Attempting to implement a two-column float CSS layout with specific width percentages. My CSS styles for the two columns are as follows:
.div1 {
width: 25%;
float: left;
}
.div2 {
width: 75%;
float: right;
}
.container {
width: 960px;
}
@media screen and (max-width: 320px) {
.div1, .div2 {
width: 100%;
display: block;
float: none;
clear: both;
}
.container {
width: 100%;
}
}
The corresponding HTML structure is:
...
<div class="container">
<div class="div1">
... content goes here
</div>
<div class="div2">
<img src="photo_location"/>
</div>
</div>
Currently, at 320px width, Div II drops below Div I as expected in responsive design. However, the goal is to have Div II appear above Div I using CSS floats. How can this approach be achieved?