html:
<div class="popBox"> <div class="pb"> <span class="clousx"></span> <div class="p-box"></div> </div> </div>
css:
.popBox { position: fixed; width: 100%; left: 0; top: 0; background: rgba(0,0,0,0.5); height: 100%; z-index: 150000; } .popBox .pb { width: 6.58rem; background: #fff; display: flex; justify-content: space-between; position: relative; font-size: 0.3rem; text-align: left; left: 0.46rem; padding-top: 0.65rem; border-radius: 0.1rem; padding: .92rem .5rem .64rem .3rem; margin-top: 2rem; overflow-y: auto;box-sizing: border-box; } .popBox .clousx { position: absolute; z-index: 20000; width: 1rem; height: 0.84rem; background: url(../images/index/close-icon.png) no-repeat center center; background-size: 0.32rem 0.32rem; display: inline-block; right: 0; top: 0; } .popBox .p-box { position: relative; height: 7rem; overflow-y: auto; }