.mui-bar-nav~.mui-content这两个class之间的 ~ 什么意思?

匹配 .mui-bar-nav 之后所有的 .mui-content(即同级的其他类或元素)

例如:

<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="UTF-8">
  <title>Document</title>

  <style>
    .a ~ .b {
      color: red;
    }
  </style>
</head>
<body>
  <div class="a">a
    <div class="b">b1</div>
  </div>
  <div class="b">b2</div>
  <div class="b">b3</div>
</body>
</html>

可以看到 b1 是不变色的,b2 和 b3 是会改变颜色的。

猜你喜欢

转载自blog.csdn.net/a_sid/article/details/80074094