How to put scroll bar only for modal-body?

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

I have the following element:

13条回答
  •  独厮守ぢ
    2020-11-30 18:28

    Adding on to Carlos Calla's great answer.

    The height of .modal-body must be set, BUT you can use media queries to make sure it's appropriate for the screen size.

    .modal-body{
        height: 250px;
        overflow-y: auto;
    }
    
    @media (min-height: 500px) {
        .modal-body { height: 400px; }
    }
    
    @media (min-height: 800px) {
        .modal-body { height: 600px; }
    }
    

提交回复
热议问题