简单教程
提交运行
代码编辑器:
<!DOCTYPE htm> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://cdn.bootcss.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet"> <div class="container"> <h2>使用 Bootstrap 创建模态框</h2> <div id="example" class="modal hide fade in" style="display: none; "> <div class="modal-header"> <a class="close" data-dismiss="modal">×</a> <h3>这是一个模态框标题</h3> </div> <div class="modal-body"> <h4>模态框中的文本</h4> <p>你可以在这添加一些文本</p> </div> <div class="modal-footer"> <a href="#" class="btn btn-success">唤醒活动</a> <a href="#" class="btn" data-dismiss="modal">关闭</a> </div> </div> <p><a data-toggle="modal" href="#example" class="btn btn-primary btn-large">点击弹出模态框</a></p> </div> <script src="/static/lib/bootstrap/2.3.2/docs/assets/js/jquery.js"></script> <script src="/static/lib/bootstrap/2.3.2/docs/assets/js/bootstrap.min.js"></script>
运行结果: