代码和老师的一样 但是container-scroll加了absolute后下面的版面就没了 找不到原因
来源:11-9 首页细节调整&首页的Vue数据绑定

慕雪0323865
2017-04-14
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="/static/css/all.css">
<link rel="stylesheet" type="text/css" href="/static/css/reset.css">
<title>书城首页</title>
</head>
<body>
<style type="text/css">
.container-warp{
height: 100%;
overflow: hidden;
position: relative;
}
.container-scroll{
position:absolute;
top:45px;
bottom: 0px;
left:0px;
right: 0px;
overflow-y:scroll;
}
</style>
<div id="root" style="width: 734px">
<div class="container-warp">
<% include include/header.html %>
<div class="container-scroll">
<% include include/index-top.html %>
<% include include/index-hot.html %>
<% include include/index-recommend.html %>
<% include include/index-female.html %>
<% include include/index-male.html %>
<% include include/index-free.html %>
<% include include/index-bottom.html %>
</div>
</div>
</div>
<script src="/static/script/pages/index.js"></script>
<script src="/static/script/vue.js"></script>
<script src="/static/script/zepto.js"></script>
</body>
</html>
2回答
-
远人
2017-04-14
container-scroll 加 absolute 会让这部分布局脱离流式定位,不在占据空间,下面的部分就会跑到最顶部被遮挡
022017-05-17 -
WebTeacher
2017-04-14
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"> <meta name="format-detection" content="telephone=no"> <link rel="stylesheet" type="text/css" href="/static/css/all.css"> <link rel="stylesheet" type="text/css" href="/static/css/reset.css"> <title>书城首页</title> </head> <body> <style type="text/css"> .container-warp{ height: 100%; overflow: hidden; position: relative; } .container-scroll{ position:absolute; top:45px; bottom: 0px; left:0px; right: 0px; overflow-y:scroll; } </style> <div id="root" style="width: 734px"> <div class="container-warp"> <% include include/header.html %> <div class="container-scroll"> <% include include/index-top.html %> <% include include/index-hot.html %> <% include include/index-recommend.html %> <% include include/index-female.html %> <% include include/index-male.html %> <% include include/index-free.html %> <% include include/index-bottom.html %> </div> </div> </div> <script src="/static/script/pages/index.js"></script> <script src="/static/script/vue.js"></script> <script src="/static/script/zepto.js"></script> </body> </html>
00
相似问题
回答 4
回答 3