父容器样式:

height:100%;
width:100%;
margin:0;
padding:0;
border:0;

 

div样式:

position:relative;
overflow:hidden;
margin:auto;
/*重要,IE兼容模式*/
height:500px;
width:500px;
top:50%;
left:50%;
margin-top:-250px;
margin-left:-250px;

 

相关文章:

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