当前第2页 返回上一页
1、按顺序引入以下三个文件(推荐:《bootstrap教程》)
1 2 3 | <link rel= "stylesheet" href= "../css/bootstrap.min.css" >
<script sype= "text/JavaScript" src= "./jquery.min.js" ></script>
<script sype= "text/JavaScript" src= "../js/bootstrap.min.js" ></script>
|
2、在页面中copy下面的代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | < button class = "btn btn-primary btn-lg" data-toggle = "modal" data-target = "#myModal" >开始演示模态框</ button >
< div class = "modal fade" id = "myModal" tabindex = "-1" role = "dialog" aria-labelledby = "myModalLabel" aria-hidden = "true" >
< div class = "modal-dialog" >
< div class = "modal-content" >
< div class = "modal-header" >
< button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "true" >×</ button >
< h4 class = "modal-title text-center" id = "myModalLabel" >标题是什么</ h4 >
</ div >
< div class = "modal-body" >
写你HTML文本
</ div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-default" data-dismiss = "modal" >取消</ button >
< button type = "button" class = "btn btn-primary" >保存添加</ button >
</ div >
</ div >
</ div >
</ div >
|
简单吧,模态框就是需要一个触发,在触发模态框的html元素加入以下属性data-toggle="modal" data-target="#myModal"
观察以下就会发现 这个data-target="#myModal"
中的myModal就是模态框所在div的id <div class="modal fade" id="myModal".............>
以上就是bootstrap 模态框用法的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
bootstrap的优缺点有哪些
bootstrap是js类库么
bootstrap 怎么添加关闭按钮
bootstrap作用是什么
bootstrap里面有什么东西
bootstrap基本结构有哪些
bootstrap如何让div居右
bootstrap用什么开发工具
为什么要使用bootstrap
bootstrap特点是什么意思
更多相关阅读请进入《bootstrap》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » bootstrap 模态框用法