使用less语法计算宽度和高度为什么?属性无效
@num: 50;
.选择器{
.选择器{
width: 20rem / @num;
height: 36rem / @num;
}
}
属性为什么会无效?
这个js文件是根据屏幕划分的 超过750px依然会划分改变font-size
所以我们需要一个限定 页面不会超过750px
@media screen and (min-width:750px){
html{
font-size: 75px!important;
}
}
因为js内的权重高于css的权重 所以需要在限定中加入提权的!important;
或者可以设置
html{
max-width:750px;
}
不过这个样式效果比较差 所以最好别这么设置