wcp-spring

<div id="bg"></div>

<style type="text/css">

  #bg{width:200px;height:200px;top:50%;left:50%;position:absolute;margin-left:-100px;margin-top:-100px;}

</style>

解释:首先设置div的左上角在整个页面的50%处,然后再向上移动他宽度和高度的一半即可实现。

分类:

技术点:

相关文章:

  • 2021-12-01
  • 2021-04-26
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-12-05
  • 2022-12-23
猜你喜欢
  • 2021-11-21
  • 2021-11-21
  • 2021-07-07
  • 2021-12-15
  • 2021-11-21
  • 2021-04-12
  • 2021-05-29
相关资源
相似解决方案