Is it possible to "rearrange" my div-blocks when i scale the window down? For example should the red div appear before the blue div, when i scale down to 0-770px width window. But when the window is min. 771px, the blue div should appear before the red div.
Im not sure it is possible withut Javascript, but a solution without javascript is deffintly preferable.
Thank you!
@charset "utf-8";
/* CSS Document */
#wrapper {
width: 1000px;
height: auto;
background-color: grey;
}
#boks-green {
width: 50%;
background-color: green;
height: 400px;
display: block;
float: left;
}
#boks-blue {
width: 50%;
background-color: deepskyblue;
height: 400px;
display: block;
position: relative;
float: left;
}
#boks-red {
width: 50%;
background-color: red;
height: 400px;
display: block;
position: relative;
float: left;
}
#boks-purple {
width: 50%;
background-color: purple;
height: 400px;
display: block;
position: relative;
float: left;
}
@media only screen and (max-width: 770px) {
#boks-green {
width: 100%;
background-color: green;
height: 400px;
display: block;
float: left;
}
#boks-blue {
width: 100%;
background-color: deepskyblue;
height: 400px;
display: block;
position: relative;
float: left;
}
#boks-red {
width: 100%;
background-color: red;
height: 400px;
display: block;
position: relative;
float: left;
}
#boks-purple {
width: 100%;
background-color: purple;
height: 400px;
display: block;
position: relative;
float: left;
}
}
<div id="wrapper">
<div id="boks-green">
</div>
<div id="boks-blue">
</div>
<div id="boks-red">
</div>
<div id="boks-purple">
</div>
</div>