Bootstrap导航的具体实现代码,供大家参考,具体内容如下
<html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE-edge"> <meta content="width=device-width,initial-scale=1"> <title>Bootstrap 101 Template</title> <link href="https://cdn.bootcss.com/bootstrap/3.3.1/css/bootstrap-theme.min.css"> <link href="https://cdn.bootcss.com/bootstrap/3.3.1/css/bootstrap.min.css"> <style> div{ border:1px solid #cccccc; } </style> </head> <body> <div> <!-- 标签式 --> <ul role="tablist"> <li role="presentation"><a href="#" >home</a><li> <li role="presentation"><a href="#" >profile</a><li> <li role="presentation"><a href="#" >Messages</a></li> </ul> <br/> <br/> <!-- 胶囊式 --> <ul> <li role="presentation"><a href="#" >Home</a></li> <li role="presentation"><a href="#" >Profile</a></li> <li role="presentation"><a href="#" >Messages</a></li> </ul> <br/> <br/> <!-- 垂直胶囊式 --> <ul> <li role="presentation"><a href="#" >Home</a></li> <li role="presentation"><a href="#" >Profile</a></li> <li role="presentation"><a href="#" >Messages</a></li> </ul> <br/> <br/> </div> <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.1/js/npm.js"></script> </body> </html>
效果图: