Daily Accumulation

css

  1. Multiple images with different widths (same height) are in one row, and need to adapt to the screen width:
    height is written in vw
    as the unit –> vw refers to the width of the browser window, that is, the width of the window is divided into 100 parts. See each How many shares of the window width does each container occupy
    -> Assume that the resolution is 1920 and the browser is full screen. The width of a container is 192px, then the share it occupies is 192/1920*100=10vw.
    –> Then set the image width to auto
    . For example:
img{
    
    
	width: auto;
	height: 2.396vw;// 图片原本设置的高度为46px, 46/1920*100j = 2.396...
}

Guess you like

Origin blog.csdn.net/be_strong_web/article/details/121920991