Bootstrap navbar-text 类的用法

bootstrapweb developmentcss framework更新于 2026/2/11 16:12:17

要将文本字符串包装在元素中,请使用 .navbar-text 类。

您可以尝试运行以下代码在 Bootstrap 中实现 navbar-text −

示例

<!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>
      <nav class = "navbar navbar-default" role = "navigation">
         <div class = "navbar-header">
            <a class = "navbar-brand" href = "#">Demo</a>
         </div>
         <div>
            <p class = "navbar-text">Copyright © 2018</p>
         </div>
      </nav>
   </body>
</html>

相关文章