排版
引用标记
用行内的小号编号指向出处。
本页内容
引用标记是陈述末尾指向出处的小号数字。它是一个链接,呈胶囊形,采用胶囊标签的色调,比正文略小,位置略高于基线。指针悬停或来源显示时,标记会填充墨色。
引用标记
<div class="max-w(480) mx-auto text-sm fg-text-body leading-md"> <p class="m(0)"> Corners are drawn as squircles where the browser has <code class="code">corner-shape</code><button type="button" class="citation" popovertarget="source-1" aria-label="Source 1">1</button><span class="popover" id="source-1" popover> <span class="flex flex-col gap-xs"> <span class="fg-text-strong font-medium"> CSS Borders and Box Decorations Module Level 4 </span><span class="fg-text-muted text-xs">W3C Working Draft · w3.org</span> </span> </span> and as circles elsewhere, with the radius scaled so both look equally round.<a class="citation" href="#ref-2" aria-label="Source 2">2</a><a class="citation" href="#ref-3" aria-label="Source 3">3</a> </p> <ol class="mt-md pl-md text-xs fg-text-muted"> <li>CSS Borders and Box Decorations Module Level 4</li> <li id="ref-2">Master UI theme guide, “Continuous corners”</li> <li id="ref-3">Figma, “Desperately seeking squircles”</li> </ol></div><div className="max-w(480) mx-auto text-sm fg-text-body leading-md"> <p className="m(0)"> Corners are drawn as squircles where the browser has <code className="code">corner-shape</code><button type="button" className="citation" popoverTarget="source-1" aria-label="Source 1"> 1 </button><span className="popover" id="source-1" popover=""> <span className="flex flex-col gap-xs"> <span className="fg-text-strong font-medium"> CSS Borders and Box Decorations Module Level 4 </span><span className="fg-text-muted text-xs">W3C Working Draft · w3.org</span> </span> </span> and as circles elsewhere, with the radius scaled so both look equally round.<a className="citation" href="#ref-2" aria-label="Source 2">2</a><a className="citation" href="#ref-3" aria-label="Source 3">3</a> </p> <ol className="mt-md pl-md text-xs fg-text-muted"> <li>CSS Borders and Box Decorations Module Level 4</li> <li id="ref-2">Master UI theme guide, “Continuous corners”</li> <li id="ref-3">Figma, “Desperately seeking squircles”</li> </ol></div><div class="max-w(480) mx-auto text-sm fg-text-body leading-md"> <p class="m(0)"> Corners are drawn as squircles where the browser has <code class="code">corner-shape</code><button type="button" class="citation" popovertarget="source-1" aria-label="Source 1">1</button><span class="popover" id="source-1" popover> <span class="flex flex-col gap-xs"> <span class="fg-text-strong font-medium"> CSS Borders and Box Decorations Module Level 4 </span><span class="fg-text-muted text-xs">W3C Working Draft · w3.org</span> </span> </span> and as circles elsewhere, with the radius scaled so both look equally round.<a class="citation" href="#ref-2" aria-label="Source 2">2</a><a class="citation" href="#ref-3" aria-label="Source 3">3</a> </p> <ol class="mt-md pl-md text-xs fg-text-muted"> <li>CSS Borders and Box Decorations Module Level 4</li> <li id="ref-2">Master UI theme guide, “Continuous corners”</li> <li id="ref-3">Figma, “Desperately seeking squircles”</li> </ol></div><template> <div class="max-w(480) mx-auto text-sm fg-text-body leading-md"> <p class="m(0)"> Corners are drawn as squircles where the browser has <code class="code">corner-shape</code><button type="button" class="citation" popovertarget="source-1" aria-label="Source 1"> 1 </button><span class="popover" id="source-1" popover> <span class="flex flex-col gap-xs"> <span class="fg-text-strong font-medium"> CSS Borders and Box Decorations Module Level 4 </span><span class="fg-text-muted text-xs">W3C Working Draft · w3.org</span> </span> </span> and as circles elsewhere, with the radius scaled so both look equally round.<a class="citation" href="#ref-2" aria-label="Source 2">2</a><a class="citation" href="#ref-3" aria-label="Source 3">3</a> </p> <ol class="mt-md pl-md text-xs fg-text-muted"> <li>CSS Borders and Box Decorations Module Level 4</li> <li id="ref-2">Master UI theme guide, “Continuous corners”</li> <li id="ref-3">Figma, “Desperately seeking squircles”</li> </ol> </div></template>第一个标记在弹出层中打开来源,其余标记跳转到来源列表。
#引用指向哪里
引用标记可以指向以下两处,两种方式都无需脚本。
- 来源列表,通常放在回答或文章末尾。标记使用
<a>,其href为对应条目的 id。 - 弹出层,显示来源的标题和出处。标记使用带有
popovertarget的<button>,紧挨着写在对应弹出层之前。弹出层打开时,标记保持填充状态。在段落内,弹出层使用<span>,因为段落不能包含<div>。
标记前不要加空格。标记是行内元素,换行时会和前面的词一起移动,不会单独出现在行首。
#无障碍
- 仅有数字不足以充当无障碍名称。为每个标记提供
aria-label,例如“来源 2”或来源的标题。 - 让读者无需操作标记也能查看来源。可快速浏览的列表比十二个弹出层更实用。
- 标记尺寸较小。数字使用与控件相同的字重,并采用等宽数字字形。操作区域随所在文本的字号增大。
#类名
| 类名 | 说明 |
|---|---|
citation | 标记使用 <a> 或 <button>。<a> 的 href 指向来源的 id。使用 <button> 时,设置 popovertarget,并将按钮紧挨着放在对应的 popover 之前。为标记设置 aria-label,例如“来源 2”。 |