C
C
Cyril2018-04-11 13:38:55
css
Cyril, 2018-04-11 13:38:55

How to make a web page not "twitch" when loading?

I designed a regular web page in which I use fonts from Google Fonts. I include them via @include in the stylesheet. For example @import url(' https://fonts.googleapis.com/css?family=Roboto:300... ') .
When a web page is opened, it "jumps" due to the fact that the fonts are not loaded immediately. The fact is that when the Google font is not loaded yet, the default font is displayed. Because of this, the page twitches.
How to make sure that there is no such side effect? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tural_osmanov, 2018-04-11
@belyaevcyrill

Attach the style file in the header of the site

F
forspamonly2, 2018-04-11
@forspamonly2

https://developer.mozilla.org/en-US/docs/Web/CSS/@...

L
Lone Ice, 2018-04-11
@daemonhk

1. Connect fonts not through Google Fonts
2. Make a preloader for the entire page, and when the page loads, remove the preloader

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question