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 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.