Answer the question
In order to leave comments, you need to log in
How to visually place an element higher than it is in the page code?
There is a code:
<div>
<p>TEXT1</p>
<p>TEXT2</p>
<h2>NEW TEXT2</h2>
<p>TEXT2.1</p>
<p>TEXT2.2</p>
<div style="display:flex;">
<div>Схема работ</div>
<div>Форма</div>
</div>
</div>
<div>Форма</div>
in the mobile version so that it remains in the document code.. But it was before the heading < H2 >
Answer the question
In order to leave comments, you need to log in
For this case, you can solve without js
<div class="wrapper">
<p class="item-1">TEXT1</p>
<p class="item-2">TEXT2</p>
<h2>NEW TEXT2</h2>
<p>TEXT2.1</p>
<p>TEXT2.2</p>
<div class="container">
<div>Схема работ</div>
<div class="form">Форма</div>
</div>
</div>
.wrapper {
display: flex;
flex-direction: column;
}
.container {
display: contents;
}
.form, .item-1, .item-2 {
order: -1;
}
1. CSS
The basic principle is this: set the parent container
.wrapper {
display: flex;
flex-direction: column;
}
.form-block {
order: 1;
}
.heading-block {
order: 2;
}
$( '#form' ).appendTo( '#block' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question