Jump to content

vertical align text in footer


Nic727

Recommended Posts

Hi,

 

Sorry for this stupid question, but it worked before and it doesn't work anymore.

I would like to center my copyright in the footer vertically in the middle of the footer, but it's not working.

 

My code :

<footer><p>© 2015</p></footer> 
footer{    display: inline-block;    background-color:black;    color: white;    height: 100px;    width: 100%;}footer p{text-align: center;vertical-align: middle;}

Thank you, I feel so stupid about this question, because I know it's easy lol. It's not about my portfolio, but just a small work for school.

Link to comment
Share on other sites

Try this:

footer{    background-color:black;    color: white;    text-align: center;    line-height: 100px;    height: 100px;    width: 100%;}footer p {    display: inline-block;    vertical-align: middle;}
Link to comment
Share on other sites

As long as its a short 1 line of text when shrunk down to smallest device width

footer{    background-color:black;    color: white;    text-align: center;    line-height: 100px;    height: 100px;    width: 100%;}

should work fine on its own, but! if the text is longer than footer width it will break outside of footer boundary.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...