HTML Introduction to HTML and CSS Make It Beautiful With CSS Select and Style by Class

Alex Michel
Alex Michel
4,746 Points

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.

5 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;
}
Alex Michel
Alex Michel
4,746 Points

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!

Alex Michel
Alex Michel
4,746 Points

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!

No problem!