You can use the Flexbox. He works as a flex container, capable of sorting and directing the elements children. To use it, you need to determine display: flex;
and direct according to the requirements you want, in your case flex-direction: column;
, this configures the column ordering of your Ivs. By default, it always directs in line.
After you apply this setting to container
, it is necessary to add to the elements children the parameter order
, setting with numerical value the order you want to display your Divs (this also applies to negative values).
.container {
display: flex;
flex-direction: column;
}
.divum {
width: 100%;
height: 200px;
background: black;
order: 2;
}
.divdois {
width: 100%;
height: 200px;
background: red;
order: 1;
}
<div class="container">
<div class="divum"></div>
<div class="divdois"></div>
</div>
There are other definitions that you can apply depending on your need on the site origamid there is great content on the subject. You can also see on CSS-Tricks and in the MDN.
In case that div would be responsive, could not do something failed from this model
– Josimara