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 trialMelissa Stark
3,955 PointsContact page columns
On my contact page I was able to get two columns but the second column is halfway down the page instead of lining up on the top like the first column. Not sure how to fix this. Any suggestions?
5 Answers
Melissa Stark
3,955 PointsOMG in my primary after "left" I had a : instead of ;
Jonathan Grieve
Treehouse Moderator 91,253 PointsThe vertical-align CSS property might work for you here.
Try selecting the columns with a CSS class and with something like
.columns {
vertical-align: top;
}
Hopefully both columns shoild align from the top. :-)
Actually failing that it looks like the video wants you to clear floats after a certain number of list items, every 4th list item, assuming you have floats on your primary and secondary columns like in the video.
:nth-child(4n) i
Check out the video around 10 minutes in.
#gallery li:nth-child(4n) {
clear: left;
}
Melissa Stark
3,955 Pointsjust did the 4th item codes but it doesn't fix the contact page columns where my facebook, email and such are. Would I put the .column is my responsive.css or the main.css?
Jonathan Grieve
Treehouse Moderator 91,253 Pointsbest guess would be the responsiveness.css file. as the goal is to do just that, help the website stay responsive.
Just make sure the columns are floated properly as per the videos or if there's no columns to clear then there will be no effect. :-)
Melissa Stark
3,955 Points@media screen and (min-width: 480px) {
/*************************** Two Column Layout ***************************/
primary {
width: 50%; float: left: }
secondary {
width: 40%; float: right;
}
/*************************** Page: Portfolio ***************************/
gallery li {
width: 28.3333%;
}
#gallery li:nth-child(4n) { clear: left; } }
This is what I have so far
Jonathan Grieve
Treehouse Moderator 91,253 PointsIt looks like you have a stray closing semi colon in your code. Try removing that and see if it has any effect?
/***************************
Page: Portfolio
***************************/
#gallery li {
width: 28.3333%;
}
#gallery li:nth-child(4n) {
clear: left;
}
Good luck. :-)
Melissa Stark
3,955 PointsThank you for your help Jonathan!