cite属性仅限blockquote、q、ins、del使用,值必须为可访问绝对url,不渲染显示,需配合footer+cite元素或figure+figcaption实现用户可见来源标注。

cite 属性不能用在 table 或 p 上
cite 属性只被 HTML5 允许出现在 blockquote、q、ins、del 这四个元素上。写 <table cite="https://example.com"> 或 <code><p cite="..."></p> 是无效标记,浏览器会忽略它,W3C 验证器会报错,辅助技术也读不到。
常见错误包括:<div cite="xxx">、<code><section cite="xxx"></section>、甚至 <td cite="xxx"> —— 这些都不是规范用法,纯属徒劳。
<h3>cite 属性值必须是可访问的绝对 URL</h3>
<p>cite 属性不是放描述文字的地方,也不是“来源说明”的快捷入口。它的值必须是合法、可访问的 URI,比如:</p>
<ul>
<li>
<code>cite="https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/blockquote" ✅
cite="https://doi.org/10.1145/123456789" ✅(DOI 转成可点击链接)cite="spec.html" ⚠️(相对路径,部署后易 404,不推荐)cite="《前端手记》" ❌(含中文标点和空格,非法)cite="作者:张三" ❌(非 URL,浏览器静默丢弃)写了但用户看不见,不是 bug,是设计如此:它只供机器读取,不渲染、不提示、不自动转成链接。
想让用户看到来源,得靠 footer + cite 元素
cite 属性本身不显示任何内容。真要让人看见“——《HTML Living Standard》,WHATWG”,必须手动写 footer,且它必须是 blockquote 的最后一个子元素:
<blockquote cite="https://html.spec.whatwg.org/"> <p>"HTML is the core markup language of the web."</p><div class="aritcle_card flexRow artxards"> <div class="artcardd flexRow"> <a class="aritcle_card_img" rel="nofollow" href="/xiazai/skill8272" title="anything-to-html"><img src="https://img.php.cn/upload/skill/000/000/081/179195588450431.jpg" alt="anything-to-html" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a> <div class="aritcle_card_info flexColumn"> <a rel="nofollow" href="/xiazai/skill8272" title="anything-to-html" class="overflowclass">anything-to-html</a> <p class="overflowclass">将调研报告、方案对比、数据分析、需求梳理、会议纪要、设计说明、代码评审、学习笔记等任务产物输出为可在浏览器直接打开的单文件 HTML,替代 Markdown 作为最终交付物。Markdown 在信息密度、视觉清晰度和可分享性上已跟不上 AI 产物的丰富度,HTML 能同时承载排版、表格、SVG 等。</p> </div> <a rel="nofollow" href="/xiazai/skill8272" title="anything-to-html" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a> </div> </div> <footer>— WHATWG, <cite>HTML Living Standard</cite></footer> </blockquote>
注意:cite 元素只能包裹作品名(如书名、标准名),不能包作者、年份、出版社或 URL;作者名等应直接写在 footer 里,用普通文本或 strong 即可。
表格数据来源别硬套 cite,用 figure + figcaption
表格不是引用内容,而是数据呈现容器。试图用 cite 属性标注“数据来自国家统计局”本质是语义错配。
正确做法是把表格放进 figure,用 figcaption 显式写出来源:
<figure><table>...</table> <figcaption>数据来源:国家统计局《2023 年国民经济和社会发展统计公报》</figcaption></figure>
如果某列数值来自第三方 API,可在对应 td 内加 title 提示,或用 small 补充说明 —— 不要用 data-source 自定义属性替代语义结构,除非你愿意自己写 JS 去解析并渲染它。










