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 CSS Selectors Selectors - Beyond the Basics Attribute Selectors

Hamza Saleemi
Hamza Saleemi
4,257 Points

Can't select the a element

I copied the code from the video but I can't seem to select the a element.

My CSS

a[target='_blank'] {
    color:#39add1;
    text-decoration:none;
    border-bottom: 1px dotted;
  }  

My HTML

 <a href="#" target="_blank">Forgot your password?</a>

Edit: I played around with it a bit and figured out the problem was that I used a ] instead of an } to close to css rule above which caused the error.

1 Answer

The quotation marks in you CSS are single marks while the ones in your HTML are double.

Try it like this and you should be fine.

a[target="_blank"] {
  color: #39add1;
  text-decoration: none;
  border-bottom: 1px dotted;
}