
- Bootstrap 4 教程
- Bootstrap 4 - 主頁
- Bootstrap 4 - 概述
- Bootstrap 4 - 環境設定
- Bootstrap 4 - 佈局
- Bootstrap 4 - Grid 系統
- Bootstrap 4 - 內容
- Bootstrap 4 - 元件
- Bootstrap 4 - 實用程式
- Bootstrap 3 與 4 之間的差異
- Bootstrap 4 有用資源
- Bootstrap 4 - 快速指南
- Bootstrap 4 - 有用資源
- Bootstrap 4 - 討論
Bootstrap 4 - 麵包屑
描述
用於顯示網站基於層次結構的資訊,並指示當前頁面在導航層次結構中的位置。Bootstrap 使用“.breadcrumb”類將列表定義為麵包屑,並透過 CSS 向列表新增分隔符。
以下示例演示此內容 -
示例
<html lang = "en"> <head> <!-- Meta tags --> <meta charset = "utf-8"> <meta name = "viewport" content = "width = device-width, initial-scale = 1, shrink-to-fit = no"> <!-- Bootstrap CSS --> <link rel = "stylesheet" href = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity = "sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin = "anonymous"> <title>Bootstrap 4 Example</title> </head> <body> <div class = "container"> <h2>Breadcrumb</h2> <nav aria-label = "breadcrumb"> <!--Add the "breadcrumb" class to ul element that represents the breadcrumb--> <ul class = "breadcrumb"> <!--Add the ".breadcrumb-item" class to each li element within the breadcrumb--> <li class = "breadcrumb-item"><a href = "#">Home</a></li> <li class = "breadcrumb-item"><a href="#">Tutorials Library</a></li> <!--Add the "active" class to li element to represent the current page--> <li class = "breadcrumb-item active" aria-current = "page">Bootstrap 4</li> </ul> </nav> </div> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src = "https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin = "anonymous"> </script> <script src = "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity = "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin = "anonymous"> </script> <script src = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity = "sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin = "anonymous"> </script> </body> </html>
將生成以下結果 -
輸出
bootstrap4_components.htm
廣告