L
L
lagudal2021-05-04 13:02:22
css
lagudal, 2021-05-04 13:02:22

How to avoid or minimize delays when applying styles for mobile?

There is a layout to which styles are applied according to the desktop first principle.
For the mob, everything is implemented with a media query.
But here there is a problem. Some elements are changed by styles quite significantly, their location changes - higher - lower, width, height, etc., etc. When reloading the page in mobile resolution, such elements are first drawn according to the layout and styles for the desktop, and only after a certain time delay are the styles for mobile pulled up and everything falls into place. It's just that when you reboot, the layout seems to "jump".
Here is an example of what I mean - the search input, first takes the width specified for the desktop, and only after some interval it is already 100%. Well, you can see how everything jumps further.
video screen
How to most effectively smooth out such "jumps" - it is clear that everything takes some time, but still.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-05-04
@anudas

Usually they make a preloader https://itchief.ru/javascript/how-to-make-preloade...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question