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 Introduction to HTML and CSS (2016) Make It Beautiful With CSS Adding a Style to several Elements using Class

need help plz ?

what did i do wrong and by the way i've solved the last question but i just wanna know what did i do wrong aprreciate your help ? :)

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

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

  </body>
</html>
styles.css
 <a>
.social-links{
  padding=15px;
  margin=10px
 }
</a>
 <a>
.social-links{
  padding=15px;
   margin=10px
}
</a>

2 Answers

Hi there lil,

In the index.html:

  1. There is no need to add any other tag outside of the anchor tags(<a></a>), so remove these.
  2. The class attribute(social-links) should be enclosed in double quotes(" ").

In the styles.css:

  1. You are required to Select and Style by Class and not by Element, so remove the anchor tags.
  2. You only need to Select the class once, so remove the duplicate class.
  3. Styling is applied in this format e.g color: #384047;

Please note the colon(:) after the property and the semi-colon(;) after the properties value.

I hope this helps. If it does, please feel free to mark it as best answer

thnks :) <3

Steven Parker
Steven Parker
229,787 Points

I see three issues in the CSS:

  • there should not be HTML tags (like "<a>") in the CSS file
  • properties should be separated by a colon (":"), not an equal sign ("=")
  • the CSS rule is duplicated

Also, while it does not affect passing the challenge, you would generally not want spaces between attributes, the equal sign, and the values in an HTML tag. It's also good practice to enclose the values in quotes.