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

CSS Sass Basics (retired) Variables, Mixins, and Extending Selectors Extending Selectors

Lucas Santos
Lucas Santos
19,315 Points

Small mistake in SASS quiz 3 of 3 question.

Just a heads up in the question for this quiz it says.

Now style a new class, .message_box. Nested inside, make sure all <a> tags within this class extend the "super_link" placeholder.

he added an underscore in the class name of .message_box when it should of been a - .message-box

underscores cannot be used when naming a class in HTML.

Not a big deal but just something I noticed

Aside from that this course is great!

1 Answer

Colin Marshall
Colin Marshall
32,861 Points

Underscores can be used in CSS class names. I think with really old browsers it might have been an issue, but that is not the case anymore. The BEM (Block Element Modifier) syntax uses underscores.

See: MindBEMding – getting your head ’round BEM syntax

Lucas Santos
Lucas Santos
19,315 Points

Nice you're rite, just always been taught to never use underscores when naming classes in HTML.. not sure why but maybe because of compatibility issues.

Colin Marshall
Colin Marshall
32,861 Points

When I first started, I read something similar to what you're talking about. I think it said to use hyphens in class names and underscores in id names.

Lucas Santos
Lucas Santos
19,315 Points

hmm interesting I'm going to read more on this, I would just never use an underscore when creating a class name so I don't run into absolutely any problems.

Colin Marshall
Colin Marshall
32,861 Points

Unless you're making websites that you want to be able to run in Netscape 4, you have nothing to worry about. When I said really old browsers might have had issues with underscores, I meant REALLY old browsers. Browsers that nobody will ever be using today.

what will the code be like

Colin Marshall
Colin Marshall
32,861 Points

Sorry, I'm not sure what your question is. Can you be a little bit more specific about what you are asking? Thanks!