Combinator:后代、子代、兄弟关系 | CSS

本章覆盖:descendant combinator;child combinator `>`;next-sibling `+`;subsequent-sibling `~`;DOM 结构与 selector 的对应;深层 descendant selector 的耦合风险;组件内部合理控制 selector 深度;结构变化导致样式失效的典型问题。

本章知识点

  • descendant combinator
  • child combinator >
  • next-sibling +
  • subsequent-sibling ~
  • DOM 结构与 selector 的对应
  • 深层 descendant selector 的耦合风险
  • 组件内部合理控制 selector 深度
  • 结构变化导致样式失效的典型问题