Modal dialog with fixed header and footer and scrollable content

后端 未结 5 1090
长情又很酷
长情又很酷 2021-02-14 16:57

I\'m trying to create a modal dialog that has an fixed header and footer and that the content (in this case list of users) inside the modal dialog is scrollable...

My be

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-14 17:25

    I haven't tested it with the version 1 of Materialize, but this is what I am using:

    .modal-header {
        padding: 14px;
        text-align: center;
        position: sticky;
    }
    .modal.modal-fixed-footer.with-header .modal-content {
        height: calc(88% - 56px) !important;
        padding: 23px !important;
    }
    

    Simply add the class with-header to the modal and add a div above '.modal-content' like so:

    
    

    The padding overwrite eliminates a pixel-wide gap that appears if you change the background of .modal-header.

提交回复
热议问题