1.让层垂直居中于浏览器窗口

div{
     position:absolute;
     top:50%;
     left:50%;
      margin:-150px 0 0 -200px;
      width:400px;
  height:300px;
  border:1px solid #008800;
}


2.绝对的定位,绝对的居中
position:absolute;

top:0;

right:0;

bottom:0;

left:0;

margin:auto;

相关文章:

  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-18
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-11-23
  • 2021-05-17
  • 2022-12-23
相关资源
相似解决方案