为了账号安全,请及时绑定邮箱和手机立即绑定

弹出框里面怎么设置固定头部和底部,有上下滚动,如代码

弹出框里面怎么设置固定头部和底部,有上下滚动,如代码

PHP
莫回无 2019-03-18 16:58:17
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <style> .jie-pop{ position: absolute; top: 15%; left: 20%; bottom: 20%; width: 60%; padding: 40px 0 60px 0; background-color: #fff; border: 1px solid #ccc; border-radius: 2px; z-index: 1001; overflow: auto; } .jie-pop .jie-pop-close{ cursor: pointer; } /*弹窗头部*/ .jie-pop .jie-pop-header{ position: absolute; top: 0; left: 0; width: 100%; height: 40px; line-height: 40px; color: #fff; background-color: #1E9FFF; } .jie-pop .jie-pop-header .left{ float: left; margin-left: 10px; } .jie-pop .jie-pop-header .left .img{ display: inline-block; margin-right: 5px; } .jie-pop .jie-pop-header .right{ float: right; margin-right: 10px; } /*弹窗身体*/ .jie-pop .jie-pop-body{ } .jie-pop .jie-pop-body .items .item { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; </style> </head> <body> <section class="jie-pop"> <div class="jie-pop-header"> <div class="left"> <span class="img"><img src="images/menu.png" width="14" height="14" alt=""/></span> <span>二年级英语</span> </div> <div class="right"> <span class="jie-pop-close"><i class="layui-icon" style="font-size: 20px; color: #fff;">&#x1006;</i></span> </div> </div> <div class="jie-pop-body"> <!--试题--> <div class="items"> <div class="item"> <div class="left"> <input type="checkbox"/> </div> <div class="right"> <p>2121</p> <p>2121</p> <p>2121</p> <p>2121</p> <p>2121</p> </div> </div> <div class="item"> <div class="left"> <input type="checkbox"/> </div> <div class="right"> <p>2121</p> <p>2121</p> <p>2121</p> <p>2121</p> <p>2121</p> </div> </div> <div class="item"> <div class="left"> <input type="checkbox"/> </div> <div class="right"> <p>2121</p> <p>2121</p> <p>2121</p> <p>2121</p> <p>2121</p> </div> </div> </div> <!--分页--> <div class="pages"> <div class="left"> <input type="checkbox"/> </div> <div class="page"> <button>sfds</button> <button>sfds</button> <button>sfds</button> <button>sfds</button> </div> <div class="page"> <button>sfds</button> <button>sfds</button> <button>sfds</button> <button>sfds</button> </div> <div class="page"> <button>sfds</button> <button>sfds</button> <button>sfds</button> <button>sfds</button> </div> </div> </div> <div class="jie-pop-footer"> <button class="layui-btn layui-btn-small layui-btn-normal jie-btn-radius">已选题目(10道)</button> <button class="layui-btn layui-btn-small layui-btn-primary jie-blue jie-btn-radius">返回</button> </div> </section> </body> </html>
查看完整描述

2 回答

?
慕桂英4014372

TA贡献1871条经验 获得超13个赞

这样:
.jie-pop-body{
    position: absolute;
    top: 40px;
    right: 0px;
    left: 0px;
    bottom: 30px;
    overflow: auto;
}
.jie-pop-footer{
    position: absolute;
    width: 100%;
    left: 0px;
    bottom: 0px;
    height: 30px;
    line-height: 30px;
    border-top: 1px solid #d8d8d8;
    background-color: #f2f5f5;
}

https://img1.sycdn.imooc.com//5c8f5da900017dca08000445.jpg

查看完整回答
反对 回复 2019-03-18
?
交互式爱情

TA贡献1712条经验 获得超3个赞

我猜你是要做“粘性定位/粘性布局”,所以,搜下这俩词试试~

查看完整回答
反对 回复 2019-03-18
  • 2 回答
  • 0 关注
  • 886 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信