freeCodeCamp Challenge Guide: Center Text with Bootstrap

Center Text with Bootstrap


Problem Explanation

The challenge introduces the class of text-center for centering text and has to be used to center the <h2></h2> element.


Hints

Hint 1

Use the class of text-center.

Hint 2

The class has to applied on the first <h2></h2> in the document.


Solutions

Solution 1 (Click to Show/Hide)

Since you need to add a class, edit the HTML of the first html <h2></h2> from:

<h2 class="red-text">CatPhotoApp</h2>

to

<h2 class="red-text text-center">CatPhotoApp</h2>
2 Likes

I still did that, <h2 class=“red-text” “text-center”>CatPhotoApp and it doesn’t center the text. What am i doing wrong? Thanks!!

I figured it out, I was adding an extra pair of " " to my main class when i didnt need too.

4 Likes