John John
John John

Reputation: 1

How to force my Footer section to be in the center

I have the following which is responsible to display the footer and the end of the page:-

<footer>
 <p> &copy; @DateTime.Now.Year - My Group </p>

        </footer>

Currently the footer is being displayed to the left side of the page, but i want to force it to be located at the center of the page. can anyone advise me on how to do this?

Upvotes: 1

Views: 75

Answers (2)

Tomas Timinskas
Tomas Timinskas

Reputation: 73

If you Want to center the text in the footer you have to do that:

 footer p{
     text-align:center;
 }

If you want to center the footer container, you have to define a with for that, and then use the margins to center it.

 footer{
     width:900px;
     margin-left:auto;
     margin-right:auto;
 }

Upvotes: 2

olly_uk
olly_uk

Reputation: 11875

just add this to your css

footer {
    text-align:center;
}

Upvotes: 3

Related Questions