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 trialStephen Laluma
Courses Plus Student 17,318 Pointspictures 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.
3 Answers
Ted Sumner
Courses Plus Student 17,967 PointsThis 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; }
Ted Sumner
Courses Plus Student 17,967 PointsPlease mark it answered if your problem is solved.
Stephen Laluma
Courses Plus Student 17,318 Pointshow do I do that? sorry, I'm really new with this.
Ted Sumner
Courses Plus Student 17,967 PointsThere is a button by answers (not comments) that lets you tag it as answered.
Stephen Laluma
Courses Plus Student 17,318 Pointsthe "best answer" right?
Christopher Loyd
Courses Plus Student 5,806 PointsChristopher Loyd
Courses Plus Student 5,806 PointsDid 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.