If css sets the picture width to refresh, it will sometimes be invalid, what's the matter?

as shown in the figure, the width of both images is set width:6rem;, but the display is like this, which needs to be refreshed several times, and occasionally will be good, but even if the css takes effect and refreshes again, it may become such a situation with different widths, and the height is fine. The setting is as much as it is, and it will not be invalid.

May.29,2021

may be suppressed by your layout, black cool version enlarged , after all, you can only guess


try to give the width to the outer div, of img and then img width:100%


A look at your right layout squeeze, take a closer look at the code
Menu