I would insist you to use CSS - Flex. Little changs to your CSS and "HTML"(too) helps what you want to achieve.
I think this might help you:
Working Demo - UPDATE
HTML
<span class="xyzContainer">
<div id="start" class="side left">
<span>left</span>
</div>
<div id="end" class="side right">
<span>right</span>
</div>
</span>
Note : Wrapped your both div
's with span
as container for both of them.
CSS
.xyzContainer
{
-ms-box-orient: horizontal;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -moz-flex;
display: -webkit-flex;
display: flex;
margin:0px;
padding:0px;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
}
.side {
height: 100px;
width: 400px;
float: left;
}
.left {
background-color: red;
}
.right {
background-color: blue;
}
span {
text-align: center;
display: block;
margin: 3px auto;
}
@media screen and (max-width: 815px) {
.left
{
order: 2;
}
}
Note : The trick here is done by the display:flex
that applied to container with order:2
to .left
class.