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

Page Layout Methods

Hello,

I am having hard time knowing what the best methods are for laying out the content on a page. From what I have learned on here there are the block, table, float and Flexbox methods.

My question is, in 2015 what is the best and most functional way to set the layout of your page with mobile first being the first goal. I am leaning towards Flexbox based off of some searching but would love to hear from someone who has been creating sites and applications .

Thank you!

2 Answers

Hey Frank, In my opinion, there is no right or wrong way to layout web content. My approach is often based on the project itself and which browsers I'd like to support.

Flexbox is fairly new and not yet fully supported by older browsers without some sort of vendor pre-fixes (i.e -webkit-flex:..., or -ms-flex:...) but you can view browser support by visiting caniuse.com.

If browser compatibility is a factor, than blocks and floats would be your best bet.

I hope this helps.

Thank for the reply Chyno, I was hoping flexbox had better support now because I am having trouble understanding or getting my content to move in the way I want it to. I guess I just need to rewatch some of the css vids and keep trying lol..Take it easy

No worries but there is nothing wrong with using flexbox, I've used it in some projects and its a great skill to have knowledge of. If there is anything I can do to help you with your current layout problems please feel free to ask. I'm here to help.