Bootstrap下拉菜单和导航栏的使用


 1.下拉菜单里面必须是<li> <a> ... </a></li>的形式,否则a标签里面的字体会没有样式;

 2.<span class="caret"></span>为下拉箭头的样式

 

 

 下拉菜单和导航栏的html代码如下:

<html>

<head>

<title>下拉菜单和导航栏练习</title>

<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
<link href="bootstrap-3.3.7-dist\css\bootstrap.min.css" rel="stylesheet">
<script src="bootstrap-3.3.7-dist\js\bootstrap.js" > </script>


<meta name="viewport" content="width=device-width, initial-scale=1">

</head>


<body>

<div class="container">

<ul class="nav nav-tabs">

<li class="dropdown">
<a href="#" data-toggle="dropdown"> Home<span class="caret"></span> </a>
<ul class = "dropdown-menu" >
<li><a href="#"> action1 </a></li>
<li><a href="#"> action2 </a></li>
<li><a href="#"> action3 </a></li>
</ul>
</li>
<li><a href="#"> Profile </a></li>
<li><a href="#"> Message </a></li>

</ul>

......................

</div>

 

</body>
</html>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM