'React-Boostrap center text

I just stumbled upon React-Bootstrap. I looked at their docs, but I couldn't find anything about centering text. Like this:

<h1 class="text-center">Hello World</h1>

So I was wondering if you can use the same technic, but apply it for React development instead. Like this for example:

<h1 classnName="text-center">Hello World</h1>

Cheers!



Solution 1:[1]

I think that this bootstrap class will works

 <h1 className="m-auto"> text </h1>

Solution 2:[2]

you have type wrong spelling className.

Solution 3:[3]

Whatever it is you'd like to align to center, Div, img, text, etc, you can align using;

<div style={{ textAlign: 'center' }}> <button> Your text here </button> </div>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 SHUBHAM
Solution 3 SegunDev