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

HTML How to Make a Website Responsive Web Design and Testing Build a Three Column Layout

Melissa Stark
Melissa Stark
3,955 Points

Contact 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
Melissa Stark
3,955 Points

OMG in my primary after "left" I had a : instead of ;

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

The 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
Melissa Stark
3,955 Points

just 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
Jonathan Grieve
Treehouse Moderator 91,253 Points

best 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
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
Jonathan Grieve
Treehouse Moderator 91,253 Points

It 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
Melissa Stark
3,955 Points

Thank you for your help Jonathan!