定位为fixed的是保存成功提示,需要设置width和height。
<div class="store-success" style="display: none" id="storeSuccess"> <span>保存成功</span> </div>
.store-success { position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 99999; margin: auto; width: 80px; height: 20px; line-height: 20px; padding: 5px 10px; color: #fff; font-size: 14px; text-align: center; background: rgba(0,0,0,0.5); }