1、清除浮动
双伪元素法(既解决外边距塌陷问题,又能清除浮动影响)
.clearfix::before, .clearfix::after { content: ""; display: table; } .clearfix::after { clear: both;
}
2、清除默认样式
* { margin: 0; padding: 0; box-sizing: border-box; } li { list-style: none; } a { text-decoration: none; }
标签:box,none,clearfix,清除,前端,after,拿来,ing From: https://www.cnblogs.com/Ghss-Qishi/p/17455775.html