Align center not working for img | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Align center not working for img

<html> <head> <img align="center" src="http://media.discordapp.net/attachments/390616940978110465/408054762832134145/Recubed.png?width=131&height=131" /> <h1 align="center">Maintenance</h1> <hr width="50%" align="center" /> <p align="center">Sorry, we are currently down for maintenance, please check back in a month!</p> <head> </html> It still doesn't work

1st Feb 2018, 5:51 PM
epic gamer
epic gamer - avatar
2 Answers
+ 1
Wrap the code in a <div align="center">, including your h1, hr and p. That way you align it all at once. Also your code should be within the body tags not head tags.
1st Feb 2018, 6:09 PM
Duncan
Duncan - avatar
+ 3
If you only have one image to align you could do it like this: <p style="text-align:center;"><img src="logo.gif" alt="Logo"></p> If you have multiple images then it would be better to create a class
1st Feb 2018, 5:54 PM
Memphis Reigns
Memphis Reigns - avatar