css中继承和直接值有什么区别

时间:2021-07-19 15:10:31

标签: css inheritance border-box

对于给定的示例,使用继承而不是直接值有什么区别或好处。

带有继承

的示例
html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

具有直接值

的示例
*,
*::before,
*::after {
  box-sizing: border-box;
}

0 个答案:

没有答案