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
John Levy
1,451 PointsTrouble with lining up boxes
I am having trouble lining up all 6 boxes. The first four are fine and line up next to each other. The problem is the fifth box instead of lining up below the first box it falls under the fourth box and the sixth box falls under the fifth box. I have been looking over the code several times but cannot see what I am doing wrong and why the fifth and sixth box do not line up under the first and second box. I have attached my code here-http://codepen.io/Johned22/pen/vKzAyd Thanks in advance
1 Answer
Steven Parker
243,898 Points
Some of your div elements may not be properly closed.
I counted 22 open tags ("<div>") but only 18 closing tags ('</div>").
A couple of the missing closing tags might be at the end of your 4th and 5th boxes. Right now the first 4 boxes are all children of the wrapper div, but the 5th box is inside the div for box number 4, and and 6th box is inside number 5. This is causing your odd display.
Also be aware that due to the center alignment property of the wrapper, even after repairs the boxes on the 2nd line will be centered and not beneath boxes 1 and 2.
And remember to select a "best answer" on your previously answered questions.