I have the following code 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>
What I want to do is, arrange the divs so that, on desktop, the image comes first, followed by the title and the description. Like so:
[This is an image] [This is a title] [This is a description]
However, when I float the title and description to right, the result I get is:
[This is an image] [This is a description] [This is a title]
Also, please not that while I can change the order of the divs in HTML to get the order I want, I want title to come first on mobile followed by image and description, hence, the order.
Edit: please note that the layout is made responsive by floating the divs. I'm looking for a workaround without removing the floats entirely.