문제

I am trying to create a two column layout using flex. Here's a codepen showing what I currently have. It works just like I want it to in Chrome and Firefox. However, in Safari, each div expands to fill the whole whole window, and the second wraps so that it's one on top of the other. I want them both next to each other.

TL;DR: Code/demo are here. Works in Chrome, Firefox. Doesn't work in Safari.

도움이 되었습니까?

해결책

Ok, I fixed it. The issue is that Safari needs a vendor-specific prefix for it to work. So if I add a display: -webkit-flex; to the flexbox and a -webkit-flex: auto; to each of the divs, it works as intended. Dontcha just love CSS browser support?

Here's a working codepen.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top