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

Stephen Laluma
PLUS
Stephen Laluma
Courses Plus Student 17,318 Points

pictures don't resize and no margins can be seen

here's my main.css code

img { max-width; 100%; }

gallery {

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

gallery li {

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

When I clicked on preview workspace, the pictures didn't resize (they are still big), and there are no margins that can be seen. I checked the syntax and it's all the same with the video.

Please help. Thanks all.

Christopher Loyd
Christopher Loyd
Courses Plus Student 5,806 Points

Did you add a pound sign (#) in front of the gallery selection to select your gallery id? When selecting id's, you need to select them with a #. When selecting classes, you'll select them with a period (.)

e.g.

#gallery li {
    // some code
}

3 Answers

This is your code formatted according to the Markdown format below. Please learn this for the future.

You have a ; instead of a : after img {max-width

img { max-width; 100%; }

gallery {

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

gallery li {

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

Please mark it answered if your problem is solved.

There is a button by answers (not comments) that lets you tag it as answered.