Div not expanding even with content inside

后端 未结 8 2187
故里飘歌
故里飘歌 2020-12-24 00:23

I have a stack of divs inside of each other, all of which have an ID which specifies CSS only.

But for some reason the surrounding DIV tag only expands to it\'s anoi

8条回答
  •  佛祖请我去吃肉
    2020-12-24 01:01

    Floated elements don’t take up any vertical space in their containing element.

    All of your elements inside #albumhold are floated, apart from #albumhead, which doesn’t look like it’d take up much space.

    However, if you add overflow: hidden; to #albumhold (or some other CSS to clear floats inside it), it will expand its height to encompass its floated children.

提交回复
热议问题