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

HTML How to Make a Website Styling Web Pages and Navigation Polish the Navigation and Footer

Tim Acker
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Tim Acker
Front End Web Development Techdegree Graduate 31,247 Points

Dash '-' in the "social-icon" class name not recognized in Chrome (v 55)

In order to get the "social-icon" class name to work on my end using Chrome (v 55) I had to remove the '-' and name the class "socialicon" instead. I read in some online documentation that a '-' (dash) and '_' (underscore) where treated the same. Is this no longer the case? Are dashes no longer allowed in class and id names?

3 Answers

Kevin Heck
PLUS
Kevin Heck
Courses Plus Student 1,290 Points

I just completed that course. I looked at my code and I have the very same thing (with the exception of having a link in the <href>.) I opened it with chrome and it worked for me. I would see if chrome needs an update. Also, if you wrote all the code out instead of copy and pasting, you might have overlooked a ; or perhaps a closing ". It happens all the time, even to the most advanced programmers.

Kevin Heck
PLUS
Kevin Heck
Courses Plus Student 1,290 Points

Hi, Timothy. Not sure where you got that information from, but chrome does indeed accept dashes. Could you post a copy of your code?

Tim Acker
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Tim Acker
Front End Web Development Techdegree Graduate 31,247 Points

Hi Kevin, thanks for the reply. Below is an extract from the "How To Make A Website" course. When I used the class name "social-icon", as the instructor demonstrated, and refreshed the output in Chrome the logos disappeared from the footer. The only way I could get them back was by replacing the dash with an underscore or removing the dash altogether.

<footer> <a href="#"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"></a> <a href="#"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a> <p>Ā© 2017 Tim Acker.</p> </footer>

.social-icon { width: 30px; height: 30px; margin: 0 5px; }