Để bọc chuỗi văn bản trong một phần tử sử dụng lớp .navbar-text.
Ví dụ
Bạn có thể chạy mã sau để đặt văn bản trong Bootstrap Navbar:
<!DOCTYPE html> <html> <head> <title>Ví dụ Bootstrap</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">Bản quyền © 2018</p> </div> </nav> </body> </html>
Lớp .navbar-text đảm bảo dòng chữ có padding và line-height phù hợp để hiển thị đẹp trong navbar.