Distribute buttons as evenly as possible

后端 未结 2 1358
轮回少年
轮回少年 2021-02-08 05:56

I have a variable width container (a div).

This container contains a variable number of buttons whose sizes

2条回答
  •  花落未央
    2021-02-08 06:13

    CSS doesn't contain enough 'math' powers (cross browser) to determine widths and available space. If they were similarly shaped, it would be easier to accomplish with a grid based system like bootstrap and media queries. But because 15 'G+' buttons fit in 2 'stackoverflow' space, it will never be the solution you want without determining element widths.

    I'd suggest resulting to the JS solution you came up with already.

提交回复
热议问题