前端-响应式布局
文章目录
1.使用vw,vh,rem
@function vw($px) {
@return ($px / 1920) * 100vw;
}
@function vh($px) {
@return ($px / 1075) * 100vh;
}
@function rem($px) {
@return ($px / 100) * 1rem;
}
2.媒体查询
@media (max-width: 860px){
.choose-button {
position: relative;
width: 100%;
margin-bottom: 0;
.px2rem(height, 92);
}
}
.px2rem(@name, @px) {
@{name}: @px / 75 * 1rem;
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论