首页 > 代码库 > 按钮固定在页面顶部

按钮固定在页面顶部

<div class="detail">
    <div class="detail-wrapper clearfix">
        <div class="detail-main">
        </div>
    </div>
    <div class="detail-close">
        <i class="fa fa-close"></i>
     </div>
</div>
.detail {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 100%;
    height: 100%;
    overflow: auto;
}
.detail-wrapper {
    width: 100%;
    min-height: 100%;
}
 .detail-main {
    margin-top: 64px;
    padding-bottom: 64px;
}
.detail-close {
    position: relative;
    width: 32px;
    height: 32px;
    margin: -64px auto 0;
    clear: both;
    font-size: 32px;
}
.clearfix {
    display: inline-block;
}
clearfix:after {
    display: block;
    content: ".";
    height: 0;
    line-height: 0;
    clear: both;
    visibility: hidden;
}

 

按钮固定在页面顶部