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 Select and Style by Class

background won't center

I added the class attribute and "card-title" to index.html and I added .card-title and text-align: center to the styles.css but the background title won't center in the preview workspace.

I'm having the same problem. Please help?

6 Answers

Hey Alex Michel,

I double-checked your code, viewed it on my browser and your <heading> is aligned to center.

Hey Alex Michel,

Your code seems to be correct and it should work fine. I haven't seen your code in your workspace but try adding this:

index.html
        <h2 class="card-title">Background</h2>
styles.css
.card-title {
text-align: center;
}

I made the changes but it still won't center. Here's my code.

Hey Alex Michel ,

The link you sent me displays an error message!

How do I link to my workspace?

You can take a snapshot of your workspace.

Here's how you do it: Go to your workspace and on the top right hand corner, there is an icon of camera to take a snapshot!

This is my snapshot. I hope it works this time.

It worked. Thanks.

No problem!

Nevermind. I fixed it.