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

Flex Box Support / Browser Testing Issues

Hi everyone,

I have been using flex box for layout on a pen i have been creating http://codepen.io/Craig-Watson/pen/QwGKrM?editors=110 , when viewed on desktop the web page responds and looks as intended. I used the codepen feature and sent the url to my phones iPhone 4s and IPhone5s ,

When looking on Can I Use it says for safari simply use -webkit- prefix but on testing this is not working?

I am still new to web design, I may have made a rookie mistake forgive my knowledge is so ...

Also when viewed on the mobile the the size of elements in comparison to when decreasing window size on desktop was drastically smaller, is this all to do with resolution :S

Thanks for any help

Craig

3 Answers

Hi Craig,

Building from mobile up you need to change the design you have now. Right now you have the look you want on a desktop.
You need to Make it appear way oversized on your desktop, so it looks okay on your mobile, then use media queries to shrink the text and things down to a size that looks normal on your desktop.

Looking at it now, its looks good on my Desktop and iPad but its to small in my iPhone.

I just increased the size of most of the items, it looks okay on my phone now, a bit to big on everything else though. But that you can fix with media queries.

Thanks Wayne!

I will adjust the sizes for mobile and use media queries to adapt for desktop I hoping using flex box will make this extra easy now ive got the prefix issues sorted. I have also had to use -ms- prefix for all IE versions in case you are ever using it.

As ever Wayne thanks for your help and advice!

Craig

Hey Craig,

I don't know if you use Sublimetext or another code editor, but whichever one you use you may want to see if you can find a auto pre-fixer for it.
I have one for Sublimetext, I just write my code as normal and the auto pre-fixer does its thing and all my code has the correct pre fixed added.

Hope this helps.

Hey Craig,

I'm using Safari 8.0.2 and this is what i see

alt text

Is this what you were expecting or not?

Hi Wayne,

unfortunately not, all elements under the nav should be centred. This is however the same layout im getting on the mobiles even with prefix syntax ....

I've tried to upload a screen shot to little affect what is the way to upload the images and i will show you how this is looking on my pc ?

Thanks Craig

If you have Dropbox

Here is the link generated by dropbox for the image.

https://www.dropbox.com/s/i8eylka2yj5odp2/Lorem-img.png?dl=0

and here is the code edited so i can insert it (removed text from beginning and end)

dropbox.com/s/i8eylka2yj5odp2/Lorem-img.png

here is the code i wrapped it in.

![alt text](https://dl.YOUR IMAGE CODE GOES HERE "Title")

so the end result is

![alt text](https://dl.dropbox.com/s/i8eylka2yj5odp2/Lorem-img.png "Title")

If you have Skitch, goto Share/Options/tick Direct image url then Share/ copy shared url, then paste it as follows

![alt text](YOUR IMAGE CODE GOES HERE "Title")

Hope this helps.

Thanks Wayne!

I have updated the pen and it should all now be centred on iOS Safari and Safari for Desktop, issue was the prefixing I was declaring the display property with prefix like this ...

-webkit-display: flex;

When in actual fact it goes like this.....

display: -webkit-flex;

I do still however have a sizing issue the page on mobiles does seem to be at a desktop resolution rather than the intended size?

I have no media queries as yet because im building up for mobile first ... would this affect anything?

Thanks Again Wayne