示例工程 51-accessibility

51-accessibility/demo-02-focus/index.html

html · 0.7 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>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <a class="skip" href="#main">跳到主内容</a>

    <h1>焦点与触控</h1>
    <p>用 Tab 走一遍,再用鼠标点一遍。</p>

    <div class="row">
      <button class="btn" type="button">按钮</button>
      <a class="link" href="#main">链接</a>
      <button class="icon" type="button" aria-label="关闭">×</button>
    </div>

    <main id="main" class="card">
      <label for="name">名字</label>
      <input id="name" placeholder="聚焦我" />
    </main>
  </body>
</html>