Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


aligning content

l have just seen flex-box tutorial on here l am a bit confused about whats the best way to align content. l know about the new html5 features and grid system also the other featured taught in the CSS tutorials on here. But as to the best approach is confusing. A suggestion of the best approach would be very much grateful and thanks in advance

2 Answers

Qichao Li
Qichao Li
Courses Plus Student 15,694 Points

I am also exploring the same thing. I wrote a website recently as a practice. As far as I am concerned, Compatibility is really important. So I have not use the flex-box yet. (For Ie7,8 and ...) And during this approach , I find something disgusting. For example, if I want a content show in both vertical and horizontal center?I have to use 3 divs to achieve that.

Grace Faires
Grace Faires
5,435 Points

I know this may seem like a cliche answer to give, but generally speaking I wouldn't say there is a 'best' approach. It's certainly worth exploring different approaches and examples that are shown on Treehouse and elsewhere, you'll soon find a method that will suit your needs/ workflow.

From personal experience though I'd say it's worth trying out a grid system - 960 grid system (960.gs) or you could use the grid css file thats included with project files in the website track here on Treehouse.

Grid systems are handy and a good place to start, as they're easy to build on, and relatively quick to get a layout together.

Hope this is at least a little helpful, have fun with it!