清楚浮动 伸缩盒子

 display: flex;
  justify-content: center;
  align-items: center;
 
 
 
 
.item_top,.item_fot{
  height: auto;
  overflow: hidden;
  clear: both;
}

 

 

 

3.使用after伪元素清除浮动(推荐使用)

.view_button:after{/*伪元素是行内元素 正常浏览器清除浮动方法*/
content: "";
display: block;
height: 0;
clear:both;
visibility: hidden;
}

————————————————
版权声明:本文为CSDN博主「h_qingyi」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/h_qingyi/article/details/81269667

posted @ 2021-04-07 10:06  k凯阳  阅读(51)  评论(0)    收藏  举报