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 trialMariya Betina
Courses Plus Student 2,026 Pointsif I add comments after <style> tag it stopes to use h1 style rule... why is it so?
e.g. <style>
<!--This part is to make my text brighter.-->
h1 {text-align: center; color: purple } h2 {text-align: center; color: coral} h3 {text-align: center; color: brown} h4 {text-align: center; color: blue} </style>
but ir correctly uses all other prescriptions. in case I delete the comment, h1 will be used.
3 Answers
Steven Parker
231,269 PointsYou didn't share any code, but I'd guess you may have used the wrong type of comment.
Within the style area, you need to use CSS-style comments.
<!-- this is an HTML-style comment (use when outside the style area) -->
<style> /* this is a CSS-style comment (use this kind inside the style area) */
</style>
Mariya Betina
Courses Plus Student 2,026 PointsI've tried /* Comment */ to pick out the comments and it works fine now.
thank you so much for your answer)) but previously I've tried <!-- comment--> signs as it was in the video... may be there are some difference between comments at the very beggining of the code and in the style part.
Mariya Betina
Courses Plus Student 2,026 Pointsmany thanks for you, guys. that was really this mistake. I used wrong type of comments.
Celeste Hebert
9,904 PointsCeleste Hebert
9,904 PointsCan you post an example?
Is it possible that you're forgetting to close the comment tag? A proper comment should look like this:
/* Comment */