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

CSS How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

tunis dehas
tunis dehas
4,863 Points

captions

Hi everyone, I put my own photos to build the web site and I filled my own captions as well , sometimes fives words at max; Because of that I haven't 3 pictures by line, sometimes, i have just one, it looks weird; Somebody knows how to fix that , thanks in advance

4 Answers

Hi Tunis,

In the Build a Three Column Layout video there was a correction to the nth-child expression in the teacher's notes below the video. The correct expression should be 3n + 1

Do you have that in responsive.css? 4n was covered in the video but make sure you switch to 3n + 1 so it will work for more than 6 images.

You can also put a similar nth-child expression in main.css to take care of this problem for the 2 column mobile layout.

In main.css:

#gallery li:nth-child(2n + 1) {
  clear: left;
}

In responsive.css: (You first have to set the clear property back to none on the items from the 2 column layout)

#gallery li:nth-child(2n + 1) {
  clear: none;
}

#gallery li:nth-child(3n + 1) {
  clear: left;
}

Let me know if this takes care of your problems.

tunis dehas
tunis dehas
4,863 Points

I tried to adjust the font size, I removed the margin and even I put on the main css the rule pseudo class used on responsive css file. Nothing works thanks for your attention

tunis dehas
tunis dehas
4,863 Points

I cut the captions and everything is ok now I m still waiting if somebody could bring me a real solution thxs

tunis dehas
tunis dehas
4,863 Points

Hi Jason, indeed i didn't see the teacher's note I follow your instructions and it works so many many thanks :-)