D
D
DanielPo2021-12-20 14:31:23
WordPress
DanielPo, 2021-12-20 14:31:23

Why is the image the wrong size?

When entering the site, the pictures are a little flattened, but after zooming in or out of the screen (Ctrl + -), the pictures become as they should and everything is fine with them.
With what it can be connected?

spoiler
61c06979a06a4748071994.png

spoiler
61c0698861e36782190496.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmitryboz21, 2021-12-21
@DaniilPo

1) By default (This style is registered) they have a height of 200.
"after increasing or decreasing the screen" - the resize event occurs, JS is processed, the styles of the elements are changed (namely, in this case, the height property of the reference elements (a strange and crutch decision ))
2) There are two ways to fix this:
2.1) Make these reference elements proportional elements (using css) and disable this script fragment (or if it's problematic to disable it, override it with the height: auto !important; style).
2.2) Trigger an event after loading the page with the script string window.dispatchEvent(new Event('resize')); The solution is ugly, but quickly solves the problem

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question