CSS - relative positioned parent div not stretching to absolute child div height

后端 未结 5 921
执念已碎
执念已碎 2020-11-28 07:08

I\'ve been googling this all morning and can\'t seem to get it to work:

I have a parent DIV with Relative positioning and a two column child DIV setup inside of it,

5条回答
  •  眼角桃花
    2020-11-28 08:14

    clearing works but ive had weird results. then i found a post that makes it much easier and perfect in all browsers.

    Set your child divs to float:left/right. Then put "overflow:hidden" on the parent. Because you haven't specified a height, it will just wrap to teh child elements perfectly. I haven't use'd clearing for ages now.

提交回复
热议问题