关键样式:

.bgbox {position:absolute;top:50%;left:50%;}

.bgbox .ndiv{height:100px;width:200px;position: relative; margin:-50px auto auto -100px;}

.ndiv的样式里margin的上边和左边边距,分别是这个容器高和宽的一半的负值


效果见示例代码:

相关文章:

  • 2022-01-30
  • 2022-02-11
  • 2022-12-23
  • 2021-12-31
  • 2021-12-01
  • 2021-12-03
  • 2021-11-27
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2021-08-31
  • 2021-06-28
  • 2021-12-23
  • 2022-01-27
  • 2021-10-10
  • 2022-01-03
相关资源
相似解决方案