Below is the code for a series of divs
div {
float: left;
width: 33.33%;
height: 50px;
}
#container {
width: 100%;
}
#title,
#image,
#descr {
display: inline-block;
}
#title,
#descr {
float: right;
}
@media only screen and (max-width: 480px) {
div {
width: 100%;
}
}
<div id="title">This is a title</div>
<div id="image">This is an image</div>
<div id="descr">This is a description</div>
I am trying to rearrange these divs so that on desktop, the image appears first, followed by the title and then the description:
[This is an image] [This is a title] [This is a description]
However, when I try floating the title and description to the right, the order gets mixed up:
[This is an image] [This is a description] [This is a title]
It's important to note that while I can change the div order in the HTML to achieve the desired sequence, I need the title to come before the image and description on mobile devices, hence the challenge.
Note: The layout has been made responsive by floating the divs. I'm exploring alternatives without completely removing the floats.