Bootstrap模态对话框用法简单示例
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Bootstrap模态对话框用法简单示例,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1900字,纯文字阅读大概需要3分钟。
内容图文
![Bootstrap模态对话框用法简单示例](/upload/InfoBanner/zyjiaocheng/336/7f70581bb58e451eabd258b7e5675ffd.jpg)
本文实例讲述了Bootstrap模态对话框用法。分享给大家供大家参考,具体如下:
环境:bootstrap-3.3.5,jquery-3.0.0
代码:
<!DOCTYPE html> <html> <head> <title>www.gxlcms.com bootstrap模态对话框</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="external nofollow" /> <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" rel="external nofollow" /> <script src="https://cdn.bootcss.com/jquery/3.0.0/jquery.min.js" ></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js" ></script> </head> <body> <h2>创建模态框(Modal)</h2> <!-- 按钮触发模态框 --> <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> 开始演示模态框 </button> <!-- 模态框(Modal) --> <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" id="myModalLabel"> 模态框(Modal)标题 </h4> </div> <div class="modal-body"> 在这里添加一些文本 </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><!-- /.modal-content --> </div><!-- /.modal --> </div> </body> </html>
小编已经将代码中所引用的bootstrap相关css、js文件全部换成了cdn形式,方便测试。
这里使用在线HTML/CSS/JavaScript代码运行工具:http://tools.jb51.net/code/HtmlJsRun测试,可得到如下显示效果:
PS:关于bootstrap布局,这里再为大家推荐一款本站的在线可视化布局工具供大家参考使用:
在线bootstrap可视化布局编辑工具:
http://tools.jb51.net/aideddesign/layoutit
希望本文所述对大家基于bootstrap的程序设计有所帮助。
内容总结
以上是互联网集市为您收集整理的Bootstrap模态对话框用法简单示例全部内容,希望文章能够帮你解决Bootstrap模态对话框用法简单示例所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。