Flexbox wraps last column of the first row in Safari

前端 未结 12 692
长发绾君心
长发绾君心 2020-11-30 18:52

The last column of the first row is wrapped to the next line when viewing in Safari, and some other iOS based browsers.

Safari:

12条回答
  •  半阙折子戏
    2020-11-30 19:49

    This seems to be a bug in Safari's rendering causing the columns to overflow (and therefore wrap) the Bootstrap container (some kind of Webkit rounding error maybe?). Since you are using Bootstrap, you should be able to achieve the desired result without using flex:

    Name

    Description

    But! Now the problem looking at your example is that you need to keep your product blocks the exact same size or the grid won't keep it's shape. One possible solution is to give .product a fixed height and adjust using media queries.

    Here is an example I made that works in Safari and other browsers: http://codepen.io/anon/pen/PZbNMX Additionally, you can use style rules to keep images or description text within a certain size to make things easier to maintain.

    Another possible solution is to use a script or jQuery plugin to allow for more dynamic uniform sizing, but I'm not as savvy with that stuff.

    I ran into the same issue when trying to combine flex and Bootstrap using Safari, so I hope this helps.

提交回复
热议问题