Scroll bar on specific div in botstrap module

My modal body has two divs side by side, one of them should have a scroll bar if its contents are too large for the modal. Unfortunately, the scrollbar appears on the modal body, not on my div.

What I have:

enter image description here

What I want:

enter image description here

My Guest panel has overflow-y for auto, I tried with "scroll", but the scroll bar is displayed but not available. I tried different values ​​for overflow on a modal body, in vain.

CSS

 #panelGuest{ overflow-y:auto; overflow-x:hidden; width: 35%; float:left; border-right:solid #ff920a 2px; min-height:100px; } 

HTML:

  <div id="modalShareBody" class="modal-body"> <div id="panelGuest" class="panel"> The div where i want the y-scrollbar </div> <div id="panelDetail" class="panel"> </div> </div> 

Here is the scenario with the problem: http://jsfiddle.net/Ua2HM/2/

+6
source share
2 answers

I did this by making the height of the modal fixed value:

 #modalShare { margin-left:-200px; height: 300px; } @media (max-width: 767px) { #modalShare { width: auto; margin-left: auto; } } #modalShareBody { overflow:hidden; } #panelGuest{ width: 35%; float:left; height: 200px; overflow-y: auto; overflow-x: hidden; border-right:solid #ff920a 2px; } #panelDetail{ float:left; width: 60%; } 

That's what you need?

+9
source

It seems to me that you need to make panelGuest position:relative and set a certain height in modalShareBody so that the panels can be 100%.

 #panelGuest{ position: relative; width: 35%; float:left; border-right:solid #ff920a 2px; min-height:100px; height: 100%; overflow: auto; } 

Here is the updated script : http://jsfiddle.net/skelly/Ua2HM/5/

+1
source

Source: https://habr.com/ru/post/945059/


All Articles