Reputation: 2711
Let's say I have the following mark-up:
<style type="text/css">
.floatleft {
float: left;
}
.floatright {
float: right;
}
</style>
<div id="container">
<div id="box1" class="floatleft"></div>
<div id="box2" class="floatright"></div>
</div>
When I view this on a small screen on an iPad or iPhone etc. The two boxes will either:
#box2
will "jump" down and position itself under #box1
.Q: How do I make #box2
jump down under the first <div />
?
Upvotes: 1
Views: 85
Reputation: 38262
You just need to remove the property float
with mediaqueries:
@media screen and (max-width:480px) {
#box1, #box2 {
float:none;
}
}
The demo http://jsfiddle.net/yYq8W/8/
Upvotes: 1
Reputation: 5158
Use media queries and remove the floating on small sized screens.
Upvotes: 1
Reputation: 155608
Change #box2
to float: left;
when on a mobile device, using a media query.
Upvotes: 1