模态对话框的尺寸
Bootstrap为模态框提供了两个尺寸类 .modal-lg
和.modal-sm
,可以为.modal-dialog
增加一个样式类,来调整模态框的尺寸。
如果模态框中的内容比较多,你希望比默认尺寸大一些,使用 .modal-lg
类;如果模态框中的内容比较少,你希望比默认尺寸小一些,使用 .modal-sm
类。如:
<div class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
...
</div>
</div>
<div class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm" role="document">
...
</div>
</div>
关于作者
歪脖先生,十五年以上软件开发经验,酷爱Web开发,精通 HTML、CSS、JavaScript、jQuery、JSON、Python、Less、Bootstrap等,著有《HTML宝典》、《揭秘CSS》、《Less简明教程》、《JSON教程》、《Bootstrap2用户指南》、《Bootstrap3实用教程》,并全部在 GitHub 上开源。