How to make a div height to fill available space

前端 未结 8 937
一整个雨季
一整个雨季 2021-02-14 11:04

I have a 3 column layout with some details below the columns.

\"enter

You will not

8条回答
  •  孤街浪徒
    2021-02-14 11:43

    In addition to adding the background color to the container, you'll also need to make the container take up the space of the children.

    You can add float:left to the container like Richard's answer or If you don't want to make the container float, you can add an empty "clear" div afterwards. It's less semantically correct, but if you can't or don't want the container floated it's another option.

    JsFiddle: http://jsfiddle.net/gvJrJ/4/

提交回复
热议问题