Javascript 如何更改模态 materializecss 的大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36993013/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 19:47:56  来源:igfitidea点击:

How to change the size of a modal materializecss

javascripthtmlmaterialize

提问by Cristian

sorry if the question is very simple but I'm new using materializeCss

对不起,如果问题很简单,但我是新手,使用 materializeCss

As I can increase the height and width of a modal materializecss ??

因为我可以增加模态 materializecss 的高度和宽度?

回答by Tosch

In order to set the height and width of the MaterializeCSS Modal you need to edit the CSS of

为了设置 MaterializeCSS Modal 的高度和宽度,您需要编辑

.modal { width: 75% !important ; height: 75% !important ; }  /* increase the height and width as you desire */

See more explanation as written by pihyper here: https://stackoverflow.com/a/34580086/3133641

在此处查看 pihyper 所写的更多解释:https://stackoverflow.com/a/34580086/3133641

回答by Nishant Baranwal

to remove vertical height only, add this in modal class. just make sure this definition does not get overwrite (avoid using !important and use specificity instead).

要仅删除垂直高度,请将其添加到模态类中。只需确保此定义不会被覆盖(避免使用 !important 并改用特异性)。

.modal { max-height: 100%; overflow: visible}

回答by user2060451

I believe the accepted offer is not the best. Use the chrome developer tools or just add the specific modal ID. You may have more than one

我相信接受的报价不是最好的。使用 chrome 开发人员工具或只添加特定的模式 ID。你可能有不止一个

div#modal5 {
width: 50%
}