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 Styling Web Pages and Navigation Style the Portfolio

What do I do if I have followed each instruction and still cannot get images to align side-by-side?

I am at the section "Style the Portfolio" and have watched the video twice to make sure my code looked alright. I cannot find any discrepancies between the video's CCS code and my own, yet the images on my website are still stacked. below is a copy of my exact code;

/********** PAGE PORTFOLIO **********/

gallery {

margin: 0; padding: 0; list-style: none; }

gallery li {

float: left; width: 45%; margin: 2.5%; background-color: #f5f5f5; color: #bdc3c7; }

gallery li a p {

margin: 0; padding: 5%; font-size: 0.75em; color: #bdc3c7; }

There are indeed hash tags before each word "Gallery".

Yeah, the hashtags are there. The message window formats them this way, when the code isn't added properly.

This might be a silly questions, but have you saved all of your files and then reloaded your browser? Also, could you post ALL of your code? Here is a link to show you how to post it properly so that it formats to look exactly as it would in your workspace.

https://teamtreehouse.com/community/posting-code-to-the-forum

1 Answer

Bernardo Cassina
Bernardo Cassina
13,523 Points

You have to use an ID selector for gallery since it is not an html element but an ID for a UL element.