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 Test: Styling by Element and Class

I am running into a challenge centering a heading on the webpage.

.card-title { text-align: center; }

When entering this along with the instructing (this is for the heading of a webpage) I noticed she was able to center the heading "Background" on the webpage, but after several attempts with me typing the above format, I could not center the text or add a border.

.card-title { text-align: center; border: solid black 3px; }

after typing this, saving and refreshing, the border was not added. Could you please let know if there is something typed incorrectly? Thanks

index.html
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <p>My amazing website</p>

  </body>
</html>
styles.css

1 Answer

Alita Edmonds
Alita Edmonds
6,068 Points

Hi! Nothing is incorrectly spelled but I think I see the problem. When you made ".card-title" you didn't apply it to an html element! If you wanted it to apply to the paragraph then you would do: <p class="card-title">My amazing Website</p>

Just a simple mistake (I have made worse!) Hope this helps!

Thanks so much! :o)