引用 JavaScript 缩放窗口后,DIV绝对居中

薄者JavaScript 缩放窗口后,DIV绝对居中
<style>
body{background-color:#cccccc;width:100%;}
#mtid{position: absolute;top:50%;left:50%}
#mtid[id]{display:table-cell;left:0;vertical-align:middle;position:static}
#boxs{position:relative;top:-50%;left:-50%;z-index:9999;width:300px}
#boxs[id]{left:0;margin:0 auto;}
div.boxstyle{border:2px solid #000;text-align:center;padding:5px;}
</style>
   <div id="mtid"> 
    <div id="boxs" class="boxstyle">
      <p>DIV绝对居中</p>
      <p>DIV绝对居中</p>
      <p>缩放窗口后,DIV自动重新居中</p>
      <p>逸品天空Web开发代码站 ASP及其他Web开发相关经典代码收集博客 - ASP交流QQ群12814238(满) 14725152(满) 14725492(开)</p>
    </div>
   </div>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值