Y
Y
Yurii2019-12-22 22:15:53
css
Yurii, 2019-12-22 22:15:53

How can I make the image shrink evenly from both ends when the screen is reduced?

Faced such a problem, when the screen is reduced to 670px, the image decreases evenly. When the screen resolution reaches 670px, the image in the block occupies the entire width of the screen. And when I continue to reduce the screen size, in the code inspector, the picture is already not reduced evenly, but is compressed only from the right side. At first I thought that it did not allow it to occupy the entire width of the menu block, but when I reduced its width, nothing changed. Only the menu block itself has become smaller in width. How can this situation be corrected?
Here are screenshots from the inspector
5dffbf7b7e719615421760.png
5dffbf8cd8c42216656120.png
Here is part of the HTML markup
5dffc007e1e8c304375989.png
And the styles for the markup above
5dffc0abc9a18161355303.png
I don’t understand why

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2019-12-22
@xmoonlight

width: 100vw;
min-width: 100vw;

K
Karpion, 2019-12-23
@Karpion

I understand that the picture is pressed to the left edge. And if you center it, then it will be in the center of the block.
You can center in many ways. The easiest way is to add the ALIGN=center option to the IMG tag.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question