示例工程 41-has-is-where

41-has-is-where/demo-02-is-where/index.html

html · 0.8 KB

运行::is 与 :where

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>:is 与 :where</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <h1>:is 与 :where</h1>

    <section>
      <h2>1. :is 合并列表</h2>
      <h3 class="demo-title">三级标题</h3>
      <h4 class="demo-subtitle">四级标题</h4>
      <button class="btn" type="button">按钮</button>
      <a class="btn link" href="#top">链接</a>
    </section>

    <section>
      <h2>2. :where 权重归零</h2>
      <span class="tag">普通 tag</span>
      <span class="tag accent">accent tag</span>
      <p class="hint">:where(.tag) 写在最后,但仍是灰色基础样式输给 .tag。</p>
    </section>
  </body>
</html>