K
K
Kirill_chaklidi2021-08-03 12:43:39
SVG
Kirill_chaklidi, 2021-08-03 12:43:39

Why does a site with svg load gpu at 100%?

Good afternoon. Not long ago I stuck 7 svg elements on the site, after that the site loads the percentage by 100% and the site lags, but if you reduce the screen, then the lags become smaller, what could this be connected with?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alfieros, 2021-08-03
@mrsexy

1) Restrict the size (width, height) for SVG properties inside the svg itself.
2) To the class inside which the SVG is located, add the will-change: auto CSS property, using the help of the GPU to draw the element.
3) Write the SVG code in the header using #shadow-root and call the svg by id in the right place.

L
lpite, 2021-08-03
@lpite

Optimize svg have svgo site

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question