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