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 trialJake Camp
578 PointsAdd a margin of 2.5% help
Hey I'm having a hard time passing this challenge, I've read 3 different posts surrounding this and changed the code exactly, to no prevail.
Am I missing something or is this just bugged?
9 Answers
Aaron HARPT
19,845 PointsI passed with this code:
gallery li {
margin: 2.5%; color: black; background: white; }
Mark Buskbjerg
20,986 PointsThis doesn't work for me
Aaron HARPT
19,845 PointsActually, #gallery li.
Armando Toossi
968 PointsThis is what I have but it still won't work...
#gallery li {
float: left;
width: 45%;
margin: 2.5;
color: black;
background-color: grey;
}
Anthony Jones
1,455 Pointsyou need to add a percent sign to the margin: (e.g. margin: 2.5%;)
Jesus Menera
17,304 PointsHi Armando, You are missing the percentage sign % like this:
margin: 2.5%;
Armando Toossi
968 PointsSorry I missed it this time because I did the exercise from start to finish 6 times now.. it doesn't work again here is the updated code:
#gallery li {
float: left;
width: 45%;
margin: 2.5%;
color: black;
background-color: grey;
}
Jesus Menera
17,304 PointsIt looks fine to me. Once I encounter a bug doing a css exercise. To fix it. I just put the code in a single line and I put the margin on the first line like this. #gallery li { margin: 2.5%; float: left; width: 45%; color: black; background-color: grey; }
Try it. You may get lucky. Your current code looks fine.
Armando Toossi
968 PointsNope that did not work lol...
Jesus Menera
17,304 PointsThe only thing I can think is maybe they are asking your for a class instead of an id. An id is like this: #gallery and a class is with a period at the beginning like this: .gallery
.gallery li { margin: 2.5%; float: left; width: 45%; color: black; background-color: grey; }
but if that doesn't work. NO WORRIES! "Hakuna matata" Just keep going and comeback to it in a couple of hours or next day. Keep up on learning.
Jake Camp
578 PointsI tried changing it to a class, it says task 3 is no longer passing. I tried removing the % sign, that doesn't work either. I think this is bugged.
Mike Dardano
2,256 PointsThere seems to be a lot of us in the same boat. I suggest we try and pass this somehow and come back to it later.
Jake Camp
578 PointsI've just reported this to Treehouse, I'll reply to this forum post when I get a response :)
Guil Hernandez
Treehouse TeacherHi there,
The code challenge requires you to change the browser's default text and background colors. If you set the text color to black or the background color to white, it doesn't detect a color change so it throws the error.
Sorry about the confusion––I just updated the task description. :)
Guil
Mark Buskbjerg
20,986 PointsThanks Guil
Mark Buskbjerg
20,986 PointsMark Buskbjerg
20,986 PointsI have the exact same experience. I've tried several solutions. Either I'm missing something in the question, or there is a bug.