1,移动端布局,出现滚动条。
实现思路:整个盒子100%,上面的盒子固定高;下面盒子内容自动撑开,margin-top:-50px; 同时给下面的盒子添加子盒子来布局,如果子盒子中的内容超过这个屏幕的高度,就会自动出现滚动条;
<template>
<div class="content">
<div class="title"></div>
<div class="main">
<div class="order_group">
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>111</span><br>
<span>112222</span><br>
<span>112222</span><br>
<span>112222</span><br>
<span>112222</span><br>
<span>112222</span><br>
<span>112222</span><br>
</div>
</div>
</div>
</template>
<style>
#app{
width: 100%;
height: 100%;
}
</style>
<style lang="scss" scoped>
.content {
width: 100%;
height: 100%;
background: #cccccc;
.title {
width: 100%;
height: 150px;
background: red;
}
.main{
margin-top: -50px;
.order_group{
margin: 0 15px 15px 15px;
background: #fff;
}
}
}
</style>