Nic727 Posted September 29, 2015 Share Posted September 29, 2015 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 More sharing options...
Ingolme Posted September 29, 2015 Share Posted September 29, 2015 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 More sharing options...
Nic727 Posted September 29, 2015 Author Share Posted September 29, 2015 Now it's better, but not in the middle. Link to comment Share on other sites More sharing options...
Nic727 Posted September 29, 2015 Author Share Posted September 29, 2015 Hmm.. It's working only with that : footer{ background-color:black; color: white; text-align: center; line-height: 100px; height: 100px; width: 100%;} But I'm not sure it's the good way. Link to comment Share on other sites More sharing options...
dsonesuk Posted September 29, 2015 Share Posted September 29, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now