F
F
fooger2019-08-25 16:54:46
css
fooger, 2019-08-25 16:54:46

Do I need to duplicate the block for adaptability?

Hello. When building for responsive devices, I very often resort to duplicating blocks (but I try to avoid them if possible). And so, in the next such block, I nevertheless decided to ask if there is an opportunity to avoid duplication?
Example: pw2upIm.pnghere is a ticket creation form. In the desktop, on the left there is a form (with a button and a description for it), on the right is a ticket preview. In a mobile phone - first there is a part of the form + a preview of the ticket + a button with a description.
If we exclude "crutches", such as placing the button absolute at the bottom, or inserting a preview between the button and the form + placing it absolute on the right, what is the best thing to do with the button and the description below it in this case - duplicate it in two places, and display one of them only on desktop and the other only on mob?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arseny, 2019-08-25
@fooger

You think logically, and:
1. Flex-shamanism
2. Grid-shamanism
3. Moving an element using JS
4. Yes, crutches are already coming here

D
DmitryLife, 2019-08-26
@DmitryLife

display:flex;
flex-direction: column-reverse;
Will solve all your questions. Or order with display: flex

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question