亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

html5 - How is the height rem of mobile phone adaptive pictures calculated?
怪我咯
怪我咯 2017-06-22 11:53:24
0
1
1290

The mobile webpage layout is two li and one line occupying the full width

li {
    width: 7.375rem;
    height: 4.5rem;
    float: left;
    margin-left: .4rem;
    position: relative;
}
li img{ width: 100%; height: 4.5rem; display: block; border-radius: .3rem; overflow: hidden; background-color: #fff;}

rem is automatically changed according to the font-size of html.
How to calculate the initial width and height value of this li?

怪我咯
怪我咯

走同樣的路,發(fā)現(xiàn)不同的人生

reply all(1)
僅有的幸福

How do you calculate rem?
Tell me my calculation method! The way I calculate it is: (screen width/effect picture width)*100+'px';
For example, the effect picture is 750 and the screen is 375, 1rem=(375/750)*100+'px', which is 1rem=50px
If a picture is 100px wide and 50px high in the rendering; the style setting is img{height:.5rem;width:1rem;}

But what I don’t understand is that if two li’s occupy one line, wouldn’t it be enough to set the li width to 50%?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template