Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrollbar in Modal box

jsfiddle

Instead of making scrollbar to whole modal-dialog how can I make it to only modal body. I have tried few methods like

.modal-dialog{
    overflow-y: initial;
}
.modal-body{
    height: 50%;
    overflow-y: auto;
}

but it didn't work in my case.

like image 526
vam Avatar asked Aug 15 '26 12:08

vam


1 Answers

Just add :

.modal-body{
    height: 200px;
    overflow-y: auto;
}

.modal-dialog {
    z-index: 1050;
}

The modal overlay (z-index:1050) is above the modal content and prevent the scroll. And you have to fix the height too.

like image 177
Sandwell Avatar answered Aug 17 '26 01:08

Sandwell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!