Why is this flexbox layout broken in Safari?

孤街醉人 提交于 2019-12-23 13:02:44

问题


So I designed this in CSS, the idea is to have a header and the rest as scrollable content.
(there's a link to a live demo at the bottom)

Alas, in Safari it is broken and looks like this:

As you can see, the height of the header is miscalculated, causing the green box to overflow.

I narrowed down the problem to a wrong calculation of flex-basis of the header. Or so I believe.

Live demo here: http://jsbin.com/zusavefoqu

Any idea how to fix it?

Thanks!


回答1:


You may need to add vendor prefixes.

Currently, flexbox is supported by all major browsers, except IE 8 & 9.

Some recent browser versions, such as Safari 8 and IE10, require vendor prefixes.

For a quick way to add all the prefixes you need, post your CSS in the left panel here: Autoprefixer.


Also, it seems like there are two problems with your layout in Safari:

  • the header overflow, and
  • the vertical scrollbar on #more is missing.

For a list of common flex bugs and their workarounds see this page: Flexbugs.



来源:https://stackoverflow.com/questions/34976604/why-is-this-flexbox-layout-broken-in-safari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!