How to put scroll bar only for modal-body?

后端 未结 13 1202
悲哀的现实
悲哀的现实 2020-11-30 18:14

I have the following element:

13条回答
  •  臣服心动
    2020-11-30 18:23

    You have to set the height of the .modal-body in and give it overflow-y: auto. Also reset .modal-dialog overflow value to initial.

    See the working sample:

    http://www.bootply.com/T0yF2ZNTUd

    .modal{
        display: block !important; /* I added this to see the modal, you don't need this */
    }
    
    /* Important part */
    .modal-dialog{
        overflow-y: initial !important
    }
    .modal-body{
        height: 80vh;
        overflow-y: auto;
    }
    

提交回复
热议问题