How does the I'mQQ site automatically increase the width of some elements when the page shrinks?

For the

page, see https://im.qq.com/download/

.

clipboard.png
for example, the an in the upper left corner (the initial width is 36px when you zoom 67% in the home), Chrome browser, and then it starts to widen to 96px under 25%, but the width does not change when you zoom in, and the width of the corresponding elements in my copied web page does not change (regardless of zooming).

I think this can avoid element misalignment to some extent when zooming, but I don"t know why.

I saw resize in EventListeners and thought it might be relevant, but no relevant content was found in the jQuery source code.


you can consider using media queries to implement


CSS3 mediaQuery


@media and (max-width: 600px) {
    div {
        width: 100%;
    }
}

you can use resize, to listen for window size changes, and then change the style, but also determine the window size, change the style through js.
$(window) .resize (function () {
.
});
query directly with media

Menu