【问题标题】:How to change the size of a modal materializecss如何更改模态materializecss的大小
【发布时间】:2016-05-02 23:08:20
【问题描述】:

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

因为我可以增加模态物化css的高度和宽度??

【问题讨论】:

  • 添加so代码以便我们提出答案。

标签: javascript html materialize


【解决方案1】:

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

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

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

【讨论】:

  • 如果您发现问题是重复,请标记它。不要再复制相同的答案。
  • 这似乎不起作用(不再起作用了?),但下面使用 max-height 的解决方案就像一个魅力。
  • 是的,我猜 OP 应该将接受的答案更改为“最大高度:100%;溢出:可见”的答案
【解决方案2】:

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

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

【讨论】:

    【解决方案3】:

    我认为接受的报价不是最好的。使用 chrome 开发者工具或只添加特定的模态 ID。你可能有不止一个

    div#modal5 {
    width: 50%
    }
    

    【讨论】:

      【解决方案4】:

      set your modal class to this code.
      
      
          .modal-info {
            max-width: 100% !important;
            max-height: 100% !important; 
            overflow-y: auto;
          } 

      【讨论】:

        猜你喜欢
        • 2015-12-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-07-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多