Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Introduction to HTML and CSS Make It Beautiful With CSS Adding a Style to several Elements using Class

What am I missing on the add padding challenge?

I keep getting a "bummer" response saying I need to add padding to the class. What could I be missing?

index.html
<!doctype html>
<html>
  <head>
    <title>List Example</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>

    <a class="social-links"href="#">Follow me on Twitter!</a>
    <a class="social-links"href="#">Send me an Email!</a>

  </body>
</html>
styles.css
class.social-links{
  padding:15px;
  margin:10px;

}

2 Answers

When you define CSS class attributes, don't put the word class, just start it with the period. The only exception to this is when you are adding attributes for a class on a specific element, in which case you would put the element name followed by a dot and the class name, like a.social-links, but that isn't necessary here. (Incidentally, that's why the earlier task passed, because the test rule was probably only looking for a dot followed by social-links and a set of curly braces, without caring what you had before the class name. In the last task, it wants to make sure that the attributes are being applied either to all elements with the class name (.social-links) or to the anchor tags with the class (a.social-links). Note that I did not test the last one, but it should work.

Thank you so much! I appreciate your time and answer, that worked.