Is it possible to make the materialize.css modal larger and remove the vertical scroll bar?

前端 未结 1 960
礼貌的吻别
礼貌的吻别 2021-02-08 21:47

I just created buttons that pops up a modal once clicked and each button has a modal that shows a different exercise gif. However the modals are too small and it is preventing t

相关标签:
1条回答
  • 2021-02-08 22:15

    yes, what you demand can be easily set.

    To increase the width of the modal, just adjust the width of the .modal class

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

    To increase the height of the modal, increase the max-height of the .modal class, like so

    .modal { width: 75% !important ; max-height: 100% !important } /* increase the width and height! */
    

    To prevent scrolling of the modal, just add the property overflow-y:hidden to the modal class, like so

    .modal { width: 75% !important ; max-height: 100% !important ; overflow-y: hidden !important ;}  /* increase the width, height and prevent vertical scroll! However, i don't recommend this, its better to turn on vertical scrolling. */
    

    For more customisability, you should put this as a custom css in a separate css sheet like mycustomstyles.css and load this as the last stylesheet in your header.

    Here's the codepen - https://codepen.io/anon/pen/LGxeOa

    0 讨论(0)
提交回复
热议问题