分别使用.nav-justified类和.nav,.nav-tabs或.nav,.nav-pills,在宽于768px的屏幕上制作宽度等于768px的父母制的标签或药片。在较小的屏幕上,导航链接被堆叠。
<!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 style = "background: #FADBD8;"> <h2>Subjects</h2> <ul class = "nav nav-tabs nav-justified"> <li class = "active"><a href = "#">Home</a></li> <li><a href = "#">Team</a></li> <li><a href = "#">Authors</a></li> <li><a href = "#">MVPs</a></li> </ul> </body> </html>