示例工程 11-blockquote-cite

11-blockquote-cite/demo-01-blockquote/index.html

html · 1.8 KB

运行:长引用演示

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

<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>长引用演示</title>
    <style>
      body { margin: 0; padding: 32px; background: #f8fafc; color: #0f172a; font-family: system-ui, sans-serif; line-height: 1.75; }
      .box { max-width: 720px; margin-bottom: 16px; padding: 18px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
      h1 { margin: 0 0 16px; font-size: 28px; }
      h2 { margin: 0 0 8px; font-size: 17px; }
      p { margin: 0 0 10px; color: #334155; }
      a { color: #2563eb; }
      blockquote { margin: 10px 0; padding: 12px 16px; border-left: 4px solid #2563eb; background: #eff6ff; color: #1e3a8a; }
      blockquote p { margin: 0 0 8px; color: inherit; }
      blockquote footer { color: #475569; font-size: 13px; }
      q { quotes: "「" "」"; }
    </style>
  </head>
  <body>
    <h1>长引用演示</h1>

    <div class="box">
      <h2>一句话用 q</h2>
      <p>文档里写:<q>标题表达层级。</q></p>
    </div>

    <div class="box">
      <h2>成段用 blockquote</h2>
      <blockquote cite="source.html">
        <p>列表把「一组项目」的关系写进结构:并列、顺序、术语解释。</p>
        <p>选错类型,读屏的播报与读者的理解都会偏。</p>
        <footer>
          —— <cite>HTML 写作规范</cite>
          <a href="source.html">来源</a>
        </footer>
      </blockquote>
    </div>

    <div class="box">
      <h2>署名放在 footer</h2>
      <blockquote cite="source.html">
        <p>引用要有出处,出处要能点开。</p>
        <footer>—— <cite>林小满</cite>,2026-11-28</footer>
      </blockquote>
    </div>
  </body>
</html>