console
<div id="app">
<div class="nav">侧边栏
<p>测试p字体</p>
</div>
<div class="content">内容</div>
</div>
@function px2Rem($px, $base-font-size: 19.2px) {
@if (unitless($px)) {
@return ($px / 19.2) * 1rem;
} @else if (unit($px) == em) {
@return $px;
}
@return ($px / $base-font-size) * 1rem;
}
*{
margin:0;
padding:0;
}
html{
font-size:19.20px;
}
html,body{
height:100%;
}
body{
font-size:px2Rem(16px);
}
#app{
position:relative;
width:100%;
height:100%;
}
.nav{
position:fixed;
left:0;
top:0;
width:px2Rem(273px);
height:100%;
background-color:#E4E4E4;
transition:all .3s;
z-index:11;
}
.content{
position:absolute;
left:px2Rem(273px);
top:0;
right:0;
bottom:0;
width:auto;
height:100%;
background-color:#CBE9CB;
overflow-y:auto;
z-index:10;
}
p{
font-size:px2Rem(20px);
}
@media only screen and (max-width: 1366px) {
html{
font-size:13.66px;
}
}