How to make child divs always fit inside parent div?

后端 未结 11 672
北海茫月
北海茫月 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条回答
  •  萌比男神i
    2020-12-08 09:53

    Make sure the outermost div has the following CSS properties:

    .outer {
      /* ... */
      height: auto;
      overflow: hidden;
      /* ... */
    }
    

提交回复
热议问题