A
A
Andrey2019-07-05 10:03:22
css
Andrey, 2019-07-05 10:03:22

Badly loaded svg icons on the site?

Good afternoon!
The other day I noticed something like this on a website. There are 4 blocks on the site, in which there are 4 svg icons, they are displayed in the block via img, that is:
<img src="icon.svg">
When you go to the site, these icons load in full size within a few seconds, break the block, and then again become normal size in style what they are asked. The site itself loads quickly, there are no problems in terms of speed.
Maybe someone faced a similar problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ronald McDonald, 2019-07-05
@Andrey_Tech

Obviously, the size of the image is set somewhere, which is loaded after (I know that in css).
Add the width and height attributes to the HTML (most likely) for the image output code.
For HTML: htmlbook.ru/html/img
For CSS: css.yoksel.ru/svg-sizes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question