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.

CSS

Jeremy Yochum
seal-mask
.a{fill-rule:evenodd;}techdegree
Jeremy Yochum
Front End Web Development Techdegree Student 6,682 Points

.form-contact works fine, but [class="form-contact"] is not working for me

Hey, I was wondering if anyone can help me with this. I cannot seem to get this code to work

[class="form-contact"] {
  padding: 20px 24px;
  background: #f4f7f8;
}

It is the only code that I have in the stylesheet. I have also cleared the cache and hard reloaded the page, but it does not work for me.

On the other hand, when I use

.form-contact {
  padding: 20px 24px;
  background: #f4f7f8;
}

Everything works fine, so the stylesheet is linked correctly. I feel like it is something very simple that I am missing, but it is keeping me from being able to move forward, so any help is appreciated.

1 Answer

Jeremy Yochum
seal-mask
.a{fill-rule:evenodd;}techdegree
Jeremy Yochum
Front End Web Development Techdegree Student 6,682 Points

So, I have figured out what happened. I do not understand why this would be the case, but in the HTML provided with the workspace there was another class name included with the class attribute for the form. <form class="form-contact br"> I did not include the "br" class name in the original code, but when I added it to the attribute selector in my CSS it works as intended. This syntax worked for me:

[class="form-contact br"] {
  padding: 20px 24px;
  background: #f4f7f8;
}