user13112961
user13112961

Reputation:

css bootstrap center text

Hellooo guys,

i'm trying to center my text with bootstrap, but nothing happens. What's wrong?

<footer class="row p-1 mt-3 bg-primary text-white">
    <p class="text-center">footer</p>
</footer>

thanks, your ramen

Upvotes: 0

Views: 95

Answers (1)

Mohammed Metwally
Mohammed Metwally

Reputation: 393

There are multiple solutions here

Solution 1

i dont see a benefit here for using row , so you can remove it unless you have col-* inside your footer

 <footer class="p-1 mt-3 bg-primary text-white">
            <p class="text-center">footer</p>
     </footer>

Solution 2

or if you want to keep row just add this class to your row justify-content-center

<footer class="row p-1 mt-3 bg-primary text-white justify-content-center">
        <p class="text-center">footer</p>
 </footer>

Solution 3

Insert a new element , add col-12 to it

 <footer class="row p-1 mt-3 bg-primary text-white ">
             <div class="col-12">
                 <p class="text-center">footer</p>
             </div>
     </footer>

Upvotes: 1

Related Questions