示例工程 05-comments-entities

05-comments-entities/demo-01-entities/index.html

html · 0.6 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>
  </head>
  <body>
    <h1>字符实体</h1>
    <p>标签要显示成文字时,写成实体:<code>&lt;section&gt;</code>。</p>
    <p>和号写作 <code>&amp;amp;</code>,页面显示 &amp;。</p>
    <p>版权 &copy; 2026,长破折号 &mdash; 这样。</p>
    <p>数字实体:&#169; 与十六进制:&#xA9; 都表示 &copy;。</p>
    <p>不换行空格:A&nbsp;B 与 A B 的差别在换行时最明显。</p>
  </body>
</html>