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 trialKelly Bauman
1,582 PointsAdding grids...
Hi there. Apologies in advance for what's probably a simple questions, but I'm wondering why adding the first grid_4 div caused the nav and text to flow around the banner? I'm under the impression that using a div element should force a new line in the document? In this case, it's producing the opposite effect?
3 Answers
Kelly Bauman
1,582 PointsApologies; obviously it has to do with the clearfix class applied to the container. Is there an "anatomy of the clearfix class" in future lessons? :-)
Oscar Perez
Courses Plus Student 15,046 PointsHi Kelly, let me try to answer your question, A simple div is a block element that will expand to force a new line in the document, but when adding a class to your element for example class="grig_4", this class may have some properties that will define a width on your div and will have float property that will flow your text around the banner. So this is why adding the first grid_4 flows your div around the banner. Now the clearfix class in simple words is kind of stoping this flow in your text or divs. Its letting the browser know that the rest of the elements should not flow and at the same time letting the browser know that some elements are floated. If your just starting in css this will be explained in detail in future lessons. I hope i answered your question or put you more in trouble hahaha. Cheers
Kelly Bauman
1,582 PointsOscar, thank you so much! i'm pretty new to all of this, and the simple things still get me. I just noticed that there's more exhaustive grid learning down the track, and am excited for it.
Again, thanks. Getting to know classes is opening my eyes to hierarchal imposition of styles; I think that's what your response speaks to.
Cheers! Kelly