模态宽度(增加) [英] Modal width (increase)

查看:69
本文介绍了模态宽度(增加)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望模态为屏幕宽度的80%左右. modal-lg不够大.这个:

I want a modal to be 80% or so of a screen width. modal-lg isn't large enough. This:

.modal .modal-dialog {
  width: 80%;
}

不适用于Bootstrap 4.

Doesn't work with Bootstrap 4.

推荐答案

引导程序3

您可以通过以下操作来创建或覆盖默认的引导程序modal-lg:

You can create or just override default bootstrap modal-lgby doing below:

.modal-lg {
    max-width: 80%;
}

如果不起作用,只需添加!important即可,如下所示

If not working just add !important so it would look like below

.modal-lg {
    max-width: 80% !important;
}

现在调用modal-lg.

<div class="modal-dialog modal-lg" role="document">
 <!-- some modal content --->
</div

有关 Bootstrap 4 ,请参阅@ kitsu.eb答案.另外请注意,使用bootstrap 4实用程序可能会破坏响应能力.

For Bootstrap 4 refer to @kitsu.eb answer. Also note that using bootstrap 4 utilities might break the responsiveness.

这篇关于模态宽度(增加)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆