Boostrap .dropup 类
菜单不仅可以向下展开,也可以向上展开。要实现此效果,只需将 .dropup 添加到父 .btn-group 容器即可。
可尝试运行以下代码集,使菜单向上展开
示例
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</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> <p>Dropup</p> <div class = "row" style = "margin-left:50px; margin-top:120px"> <div class = "btn-group dropup"> <button type = "button" class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown"> Subject <span class = "caret"></span> </button> <ul class = "dropdown-menu" role = "menu"> <li><a href = "#">Programming</a></li> <li><a href = "#">Web Dev</a></li> <li><a href = "#">Database</a></li> <li><a href = "#">Networking</a></li> </ul> </div> </div> </body> </html>
广告