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 trialAsh Powell
2,795 PointsI've set the color of the text and background, but the code isn't being accepted!
gallery li {float:left;width:45%;margin:2.5%;color:#000;background:#ccc}
Please can someone tell me why this isn't being accepted?
Ash Powell
2,795 PointsSorry that should be #gallery not just gallery - for some reason it's not showing correctly
Aurelian Spodarec
7,369 PointsOkay :) Remember that when you set and id in HTML and want to define it in CSS its" # ". Same for class but insted of # you must use a dot " . "
1 Answer
James Andrews
7,245 Pointsyou're missing the hash tag in front of gallery..
#gallery li { ..... }
the hashtag identifies that you are selecting the tag with the ID gallery
Ash Powell
2,795 PointsI do have that on my actual code, and when editing the main question again the # is there, when saved it disappears for some reason. It's definitely there on the actual code
Aurelian Spodarec
7,369 Pointsit disappears because that symbol is ued to display code with other symbol so it disapears . Look somewhere how to put a code in treehouse . :)
James Andrews
7,245 Pointsyou need to wrap your code in 3 back tick symbols before and after the code for it to show like mine.
As for the CSS it is correct so why it's not working I do not know.
Ash Powell
2,795 PointsOk thanks for the advice.. I'm not sure what the problem was but refreshing the page and then rewriting fixed it.
Thanks again everyone for your help
Aurelian Spodarec
7,369 PointsAurelian Spodarec
7,369 PointsWhere do you want to set your code for ? The code seem allright but you might just mess up with " gallery li" depends where you wanted it to set.