示例工程 08-text-semantics
08-text-semantics/demo-02-inline-code/index.html
点击「运行示例」后,左侧显示源码、右侧显示运行结果;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; }
code { padding: 1px 5px; border-radius: 4px; background: #f1f5f9; font-family: ui-monospace, monospace; }
kbd { padding: 1px 6px; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 4px; background: #fff; font-family: ui-monospace, monospace; }
mark { background: #fef08a; color: #422006; }
abbr[title] { text-decoration: underline dotted; cursor: help; }
</style>
</head>
<body>
<h1>代码、术语与时间</h1>
<div class="box">
<h2>代码与输入输出</h2>
<p>按 <kbd>Ctrl</kbd> + <kbd>K</kbd> 打开搜索。</p>
<p>调用 <code>verify()</code> 检查结构。</p>
<p>终端输出 <samp>PASS 1 篇齐全</samp>。</p>
<p>变量 <var>count</var> 表示章节数。</p>
</div>
<div class="box">
<h2>术语与缩写</h2>
<p><abbr title="HyperText Markup Language">HTML</abbr> 描述结构,<abbr title="Cascading Style Sheets">CSS</abbr> 描述样式。</p>
<p><dfn>内容模型</dfn>规定一个元素能包含哪些子元素。</p>
<p>规范写道:<q>标题表达层级。</q></p>
</div>
<div class="box">
<h2>时间与变化</h2>
<p>更新于 <time datetime="2026-11-28">11 月 28 日</time>。</p>
<p>旧价 <del>99 元</del>,新价 <ins>79 元</ins>。</p>
<p><mark>限时</mark>内容用 mark 标注。</p>
</div>
</body>
</html>