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

I can't get this class attribute to work.. Help?

I am on the lesson titled "Write the CSS" in the "intro to HTML and CSS" I've looked over it several times and I can't seem to figure out why the class attribute isn't working? I copied and pasted the code below..

The HTML <h2 class="section-title"> Summary Of Qualifications</h2>

The CSS .section-title { text-transform: uppercase; }

Is the CSS in the HTML document, or does the HTML link to the CSS file?

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

There isn't a technical reason why that code should not cause the element to change. But one thing you could try is using

h2.section-title {
}

As your selector for the CSS. This would tell the browser only to target heading level 2 elements that have that class rather than every single element with the class.

(By the way, check out the markdown content on Treehouse for info on how to format code in the forums like I've done. 🙂)