跳到主要内容位置

现代CSS样式重置最佳实践!

当开始一个新的前端项目时,首要任务就是重置 CSS 中的一些默认样式。下面就来看看在现代 CSS 中如何进行样式重置。本文将深入研究每条规则,以了解它的作用和使用它的原因!


*, *::before, *::after {  box-sizing: border-box;}* {  margin: 0;}html, body {  height: 100%;}body {  line-height: 1.5;  -webkit-font-smoothing: antialiased;}img, picture, video, canvas, svg {  display: block;  max-width: 100%;}input, button, textarea, select {  font: inherit;}p, h1, h2, h3, h4, h5, h6 {  overflow-wrap: break-word;}#root, #__next {  isolation: isolate;}