Variable content div height using css with fixed header and footer

后端 未结 4 1121
忘掉有多难
忘掉有多难 2021-01-03 05:31

I\'m having a bit of trouble with some CSS, and am seeking some help from this wonderful community.

I am trying to build a layout containing the following elements:<

4条回答
  •  旧巷少年郎
    2021-01-03 05:55

    Use a table or display: table-cell for content which has to have the same height.

    [EDIT] A three column layout with a table is done in a couple of minutes and it works.

    All those hacks using floating divs just create brittle layouts which sometimes work and sometimes fail. They are hard to debug, hard to get right and need a lot of CSS styles and HTML code. For little return. So if you want to waste a couple of days to get it to work, by all means use floating divs.

    It's not my fault that someone said "tables are bad." It's like saying "the sun is bad because it burns you." Well, use it appropriately.

提交回复
热议问题