How to make child divs always fit inside parent div?

后端 未结 11 668
北海茫月
北海茫月 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:28

    you could use inherit

    #one {width:500px;height:300px;}
    #two {width:inherit;height:inherit;}
    #three {width:inherit;height:inherit;}
    

提交回复
热议问题