bootstrap 下拉菜单显示不出来
2 回答
湖上湖
TA贡献2003条经验 获得超2个赞
以下代码测试通过,对容器的class添加dropdown,使得菜单可出现在其下方
1234567891011121314151617181920212223 | <!doctype html> < html > < head > < meta charset = "utf-8" > < title >bootstrap测试</ title > < link href = "http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.min.css" rel = "stylesheet" /> < link href = "http://cdn.bootcss.com/bootstrap/css/bootstrap-theme.min.css" rel = "stylesheet" /> </ head > < body > < div class = "container dropdown" style = "margin-bottom: 50px" > < h2 class = "page-header" > 下拉菜单</ h2 > < a class = "btn dropdown-toggle" data-toggle = "dropdown" href = "#" >字体< span class = "caret" ></ span ></ a > < ul class = "dropdown-menu" > < li >< a href = "#" >宋体</ a ></ li > < li >< a href = "#" >黑体</ a ></ li > < li >< a href = "#" >楷体</ a ></ li > </ ul > </ div > < script src = "http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js" ></ script > < script src = "http://cdn.bootcss.com/bootstrap/3.2.0/js/bootstrap.min.js" ></ script > </ body > </ html > |
拉风的咖菲猫
TA贡献1995条经验 获得超2个赞
我也发现和楼主相同的问题,经过测试bootstrap.min.css,bootstrap-theme.min.css,bootstrap.min.js,和jq这四个文件都需要引入才能用,只是引入bootstrap.min.css的话只是有了样式,很多的特效就没法用,实际上还是很多依赖了jq
- 2 回答
- 0 关注
- 2047 浏览
添加回答
举报
0/150
提交
取消