Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Drew Butcher
Drew Butcher
33,160 Points

Flex formating in Safari

I am having some issues with displaying content that has a flex box in safari. Here is the basic HTML code:

<div class="panel">
  <div class="panel-heading">Heading</div>
  <div class="panel-body">
    Body with a lot of content 
    Body with a lot of content 
    Body with a lot of content 
    Body with a lot of content 
    Body with a lot of content
    Body with a lot of content 
    Body with a lot of content 
    Body with a lot of content
    Body with a lot of content
  </div>
</div>

I'm writing is SASS and here is the basic styling of the content....

.panel{
  border: 1px solid black;
  display: flex;
  & > .panel-heading {
    border: 1px solid green;
  }
  & > .panel-body {
    border: 1px solid blue;
  }
}

The problem occurs in Safari only: The first flex item panel-heading is being overtaken by the second flex item panel-body.

Here is a JSFiddle for your viewing https://jsfiddle.net/kf8yybwx/1/

2 Answers

Drew Butcher
Drew Butcher
33,160 Points

This post answered my question: http://stackoverflow.com/questions/32689686/overlapping-css-flexbox-items-in-safari

the solution that worked for me was to use:

flex-shrink: 0;
Cindy Lea
PLUS
Cindy Lea
Courses Plus Student 6,497 Points

Other student s were asking this same thing about Safari not working like the other browsers. Heres an article that list some info on this....not sure if you can use but hope it helps:

http://stackoverflow.com/questions/24899943/how-to-make-flex-box-work-in-safari