How to make child divs always fit inside parent div?

后端 未结 11 675
北海茫月
北海茫月 2020-12-08 09:13

My question is if there is a way, without using JavaScript, to cause child divs to extend to the borders of their parent, without exceeding those borders, when you cannot kn

11条回答
  •  旧巷少年郎
    2020-12-08 09:40

    I had a similar problem, but in my case, I have content in my div that height-wise will exceed the boundaries of the parent div. When it does, I want it to auto-scroll. I was able to accomplish this by using

    .vscrolling_container { height: 100%; overflow: auto; }
    

提交回复
热议问题