How do you set a floating div's width to take up remaining space without pushing other divs down?

前端 未结 2 2142
攒了一身酷
攒了一身酷 2021-02-08 00:37

For part of a layout I want to make, I want to use three divs, all floating next to each other. The Left and Right have a max-width set, which works fine, but I want the middle

2条回答
  •  半阙折子戏
    2021-02-08 01:24

    I don't want to dredge up an old thread here but I was looking for a solution to my own problem and came across this and I thought I'd better share with Francisco...

    Tables are a terrible idea for positioning layout, the main problem is that before a table will show/render in the browser it has to render it's tag.

    Could you imagine if Facebook's column content used a table for it's layout, it would take ages for it to render anything to the screen when checking your timeline for instance! Another issue is that tables behave extremely differently in each browser.

    Basically:

    for layout = NO!,
    for listing out rows of data or information = YES!

    提交回复
    热议问题