国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

Bootstrap布局組件教程之Bootstrap下拉菜單

2019-11-20 09:44:06
字體:
供稿:網(wǎng)友

本章將重點(diǎn)介紹 Bootstrap 下拉菜單。下拉菜單是可切換的,是以列表格式顯示鏈接的上下文菜單。這可以通過與 下拉菜單(Dropdown) JavaScript 插件 的互動(dòng)來實(shí)現(xiàn)。

如需使用下列菜單,只需要在 class .dropdown 內(nèi)加上下拉菜單即可。下面的實(shí)例演示了基本的下拉菜單:

<!DOCTYPE html><html><head><title>Bootstrap 實(shí)例 - 下拉菜單(Dropdowns)</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><div class="dropdown"><button type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">主題<span class="caret"></span></button><ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1"><li role="presentation"><a role="menuitem" tabindex="-1" href="#">Java</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">數(shù)據(jù)挖掘</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">數(shù)據(jù)通信/網(wǎng)絡(luò)</a></li><li role="presentation" class="divider"></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">分離的鏈接</a></li></ul></div></body></html>

結(jié)果如下所示:


Bootstrap 下拉菜單選項(xiàng)

Bootstrap 下拉菜單​對(duì)齊

通過向 .dropdown-menu 添加 class .pull-right 來向右對(duì)齊下拉菜單。下面的實(shí)例演示了這點(diǎn):

<!DOCTYPE html><html><head><title>Bootstrap 實(shí)例 - 向右對(duì)齊下拉菜單</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><div class="dropdown"><button type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">主題<span class="caret"></span></button><ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1"><li role="presentation"><a role="menuitem" tabindex="-1" href="#">Java</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">數(shù)據(jù)挖掘</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">數(shù)據(jù)通信/網(wǎng)絡(luò)</a></li><li role="presentation" class="divider"></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">分離的鏈接</a></li></ul></div></body></html>

結(jié)果如下所示:

Bootstrap 下拉菜單標(biāo)題

您可以使用 class dropdown-header 向下拉菜單的標(biāo)簽區(qū)域添加標(biāo)題。下面的實(shí)例演示了這點(diǎn):

<!DOCTYPE html><html><head><title>Bootstrap 實(shí)例 - 下拉菜單標(biāo)題</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><div class="dropdown"><button type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">主題<span class="caret"></span></button><ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1"><li role="presentation" class="dropdown-header">下拉菜單標(biāo)題</li><li role="presentation" ><a role="menuitem" tabindex="-1" href="#">Java</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">數(shù)據(jù)挖掘</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">數(shù)據(jù)通信/網(wǎng)絡(luò)</a></li><li role="presentation" class="divider"></li><li role="presentation" class="dropdown-header">下拉菜單標(biāo)題</li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">分離的鏈接</a></li></ul></div></body></html>

結(jié)果如下所示:


以上所述是小編給大家介紹的Bootstrap布局組件教程之Bootstrap下拉菜單的相關(guān)知識(shí),希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)武林網(wǎng)網(wǎng)站的支持!

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 黔西| 南安市| 阿克苏市| 新竹县| 兴山县| 镇平县| 本溪| 柯坪县| 南召县| 双流县| 乌鲁木齐县| 乌海市| 修武县| 沙坪坝区| 喀什市| 安乡县| 盐城市| 鄂托克旗| 乐至县| 榆林市| 闸北区| 平罗县| 原平市| 文山县| 曲水县| 安塞县| 大渡口区| 裕民县| 茌平县| 台江县| 合作市| 普兰店市| 六安市| 无棣县| 霸州市| 工布江达县| 兴安盟| 宝应县| 东海县| 蓬莱市| 隆安县|