示例工程 59-blog-cards

59-blog-cards/demo-02-pagination/index.html

html · 0.9 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>当前页用实色与 aria-current。</p>

    <nav class="pagination" aria-label="分页">
      <a class="page-link disabled" href="#" aria-disabled="true">上一页</a>
      <a class="page-link current" href="#" aria-current="page">1</a>
      <a class="page-link" href="#">2</a>
      <a class="page-link" href="#">3</a>
      <a class="page-link" href="#">下一页</a>
    </nav>

    <div class="empty">
      <p class="empty__title">还没有文章</p>
      <p>新文章发布后会出现在这里。</p>
      <a class="empty__link" href="#">返回首页</a>
    </div>
  </body>
</html>