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
John Sawyer
1,305 PointsWhy does text in Sublime change color?
For example I will type <div id="Featured Drink" class="grid_11">
Some is white, some red, some green, some yellow, etc.........
Any guidance is greatly appreciated. Thanks.
5 Answers

Guil Hernandez
Treehouse TeacherYou're welcome, John Sawers.
Usually, that's not the case with syntax highlighting. Different text editors have different themes for syntax highlighting. For instance, Sublime Text 2's default theme highlights CSS class and ID selectors in green and element selectors in red. CSS properties are highlighted in blue, while the values are purple – length units in the value are highlighted red, etc...
If you switch to a different theme, the syntax highlighting usually changes depending on the theme.

Guil Hernandez
Treehouse TeacherHi John Sawyer,
It's a syntax highlighting feature most text editors have –– makes your code easier to read and maintain. Take a look: http://en.wikipedia.org/wiki/Syntax_highlighting
John Sawyer
1,305 PointsThanks so much Guil!
I just went through the wiki link you sent briefly and it definitely helps me understand the "why". Was there a section also within that gets more detailed? For example:
Red = You code is horrible Green = Your code rocks Yellow = Your code doesn't like you etc, etc.

Greg Shilling
3,723 PointsOhh, I actually replied to you in your other thread, but I think you may be misunderstanding syntax highlighting here.
The colors don't directly tell you whether your code is 'good' or not (though you can use the colors to see if you've made any mistakes).
They just help you see what is what. For example, if you type <div id = "myDiv">Text</div>, you'll see that all the tags ( < and > ) have the same color, Text is in one color, the two "div"s are in one color and "myDiv" is in yet another color. This is just to help you see what you're doing. In no way do the colors say anything about whether you've made any mistakes.
However, if you were to type : <div id = "myDiv> Text </div> , you would quickly see something IS wrong. Try it out in Sublime and you should be able to identify the problem in that small code snippet (turn on syntax highlighting for HTML). I hope that explains it. Have fun coding :-)
John Sawyer
1,305 PointsCool!
Thanks so much again sir. I'm on my way to coding domination......
Salud!

Greg Shilling
3,723 PointsOhh, I actually replied to you in your other thread, but I think you may be misunderstanding syntax highlighting here.
The colors don't directly tell you whether your code is 'good' or not (though you can use the colors to see if you've made any mistakes).
They just help you see what is what. For example, if you type <div id = "myDiv">Text</div>
: you'll see that all the tags ( < and > ) have the same color, Text is in one color, the two "div"s are in one color and "myDiv" is in yet another color. This is just to help you see what you're doing. In no way do the colors say anything about whether you've made any mistakes.
However, if you were to type : <div id="myDiv>Text</div>
, you would quickly see something IS wrong. Try it out in Sublime (type it exactly like that) and you should be able to identify the problem in that small code snippet (turn on syntax highlighting for HTML). I hope that explains it. Have fun coding :-)
Edit: sorry for the comment above, made a mistake and can't delete :)