使用 active 类自定义链接以指示当前页面

bootstrapweb developmentcss framework更新于 2026/2/11 20:28:17

您可以使用 active 类自定义链接以指示当前页面。

您可以尝试运行以下代码,使用 active 类自定义链接

示例

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <h2>Elements</h2>
      <ul class = "pagination">
         <li><a href = "#">«</a></li>
         <li class = "active"><a href = "#">e1</a></li>
         <li class = "disabled"><a href = "#">e2</a></li>
         <li><a href = "#">e3</a></li>
         <li><a href = "#">e4</a></li>
         <li><a href = "#">»</a></li>
      </ul>
   </body>
</html>

相关文章