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 trialJoe Williams
4,014 PointsWhat was the keyboard shortcut on a Mac to switch a line of CSS from code to a comment?
I know Nick mentioned it in a video, but I don't remember which, and Google isn't being too helpful.
2 Answers
Sreng Hong
15,083 PointsIt's an a Mac shortcut. It's a text editor shortcut, but I'm sure that all the editors have that.
All you do is to select the code you want to comment and hit command + /
It works in most editors such as Workspace, Sublime, Bracket, Textmate...
Hope this helps.
Shawn Flanigan
Courses Plus Student 15,815 PointsI'm not sure about a keyboard shortcut, but you can comment out a line of css by adding two slashes (//
) to the beginning of your line. If you want to span multiple lines, start with /*
and end with */
and anything in between will be a comment.
Joe Williams
4,014 PointsJoe Williams
4,014 PointsThis is exactly what I was looking for. Thanks!
Sreng Hong
15,083 PointsSreng Hong
15,083 PointsYour welcome