CSS fluid columns, fixed margins; the holy grail of holy grails

后端 未结 10 620
深忆病人
深忆病人 2020-12-12 10:56

Update & Summary

I feel obligated to make this question clearer, now that there is a bounty attached.

(Also, I\'m pretty sure this will be child\'s

10条回答
  •  囚心锁ツ
    2020-12-12 11:33

    Check out thirtydot's answer in this thread for a pure CSS/HTML (Fluid layout with equally spaced "columns" without JavaScript)...

    Fluid width with equally spaced DIVs

    http://jsfiddle.net/thirtydot/EDp8R/

    Modification of the JSFiddle demonstrates that the "columns" can be made to be different fixed widths and still have equal and fluid margins.

    http://jsfiddle.net/EDp8R/43/

    Then finally, another example using percentages while still maintaining equal and fluid margins.

    http://jsfiddle.net/EDp8R/45/

    I realize this may not be an exact solution but it gets you pretty close, I think.

提交回复
热议问题