1. 程式人生 > 其它 >使用<details>標籤在網頁裡面新增腳註

使用<details>標籤在網頁裡面新增腳註

技術標籤:htmlhtml註腳details

使用 details 標籤可以為文章新增相應註解
程式碼:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
<style> details, summary { display: inline; vertical-align: super; font-size: 0.75em; } summary { cursor: pointer; } details[open] { display: contents; } details[open]::before { content: " ["; } details[open]::after
{ content: "]"; }
</style> </head> <body> The most cited work in history, for example, is a 1951 paper <details> <summary>1</summary> Lowry, O. H., Rosebrough, N. J., Farr, A. L. & Randall, R. J. J. Biol. Chem. 193, 265–275 (1951). </
details
>
describing an assay to determine the amount of protein in a solution. </body> </html>

效果如下:
註釋效果