示例工程 28-buttons-forms

28-buttons-forms/demo-01-buttons/index.html

html · 1.1 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>
    <h1>按钮状态</h1>
    <p>用 Tab 键走一遍,观察焦点环;禁用按钮不可聚焦。</p>

    <div class="row">
      <button class="btn primary" type="button">主要</button>
      <button class="btn" type="button">次要</button>
      <button class="btn ghost" type="button">幽灵</button>
      <button class="btn danger" type="button">危险</button>
    </div>

    <div class="row">
      <button class="btn primary sm" type="button">小</button>
      <button class="btn primary" type="button">默认</button>
      <button class="btn primary lg" type="button">大</button>
      <button class="btn primary" type="button" disabled>禁用</button>
      <button class="btn primary loading" type="button" aria-busy="true">
        <span class="spinner" aria-hidden="true"></span> 加载
      </button>
    </div>
  </body>
</html>