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

后端 未结 10 617
深忆病人
深忆病人 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:25

    I have recently developed an alternative solution for this which allows for any combination of flexible columns within a row with a fixed and consistent margin across all columns, regardless of the parent element's width.

    This doesn't use any JavaScript and works in IE8+.

    In this solution the margin is defined on two classes - so it is easy to change it for responsive designs. The column widths are also representative of the space they use, for example a 2 column row has widths of 50% and a 4 column row has widths of 25%.

    You can see an example at http://www.andrewjamestait.co.uk/conflexgrids/

    Or it is available on GitHub at https://github.com/andrewjtait/conflexgrids

提交回复
热议问题