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

Darren Healy
seal-mask
.a{fill-rule:evenodd;}techdegree
Darren Healy
Front End Web Development Techdegree Student 23,565 Points

CSS Layout Techniques

I'm wondering after taking the CSS layout techniques course...

If you are tackling a project, do you usually stick to one layout technique? It seems that you would, as the code would be rather messy if using several across one website. But then I'm not too experienced with this yet and there might a case for using more than one.

Just looking to get an expert or more experienced thoughts.

Guil Hernandez ?

3 Answers

Iago Wandalsen Prates
Iago Wandalsen Prates
21,699 Points

Its quite common to use more than one layout technique in one website, even tough you could build a site with just position relative/absolute, for example, some techniques are more appropriate in a given context. Its not a good idea to build a whole site using absolute positioning, but to display one element on top of the other, it might be the best solution.

Darren Healy
seal-mask
.a{fill-rule:evenodd;}techdegree
Darren Healy
Front End Web Development Techdegree Student 23,565 Points

Thanks Iago, you've helped me a little, but I'm really looking for a more developed answer. As a newbie I need a little bit of spoon feeding. What's the best practice for it if you are starting off? Should I choose one I'm most comfortable with and build from there? Looking for some real life examples too, maybe what other people do when they are looking at projects.

Iago Wandalsen Prates
Iago Wandalsen Prates
21,699 Points

Use the one you are more comfortable with. I've started using float based design, but as the video shows, you will have to use the clearfix sometimes. Now I'm using a grid system that handles this for me, and it uses display: inline-block. I'm looking forward to being able to use flexbox, and when I don't need to worry about older browsers, I do use it already. There's not one single best practice, if there was, the videos would have said, as long as you aren't positioning with tables, you are ok.