+ 4

How to make img at center?

1st Mar 2017, 11:28 AM
vedansh singh
vedansh singh - avatar
5 Answers
+ 9
<div align=center> <img src="img.jpg"> </div>
1st Mar 2017, 7:31 PM
Shehab Amr
Shehab Amr - avatar
+ 2
<center> tag element and 'center' tag attribute are deprecated in Html5. You must use Css to align text and/or elements: <div style="text-align:center;"> <img src="image.url" alt="description"> </div> But you should prefer to avoid use of inlined style ( reserv them to dynamic use with JavaScript ), other than at building/debugging step ^^
2nd Mar 2017, 7:22 AM
visph
visph - avatar
- 1
its not working
1st Mar 2017, 1:07 PM
vedansh singh
vedansh singh - avatar
- 1
<img align="center" src="index.jpg">
1st Mar 2017, 4:46 PM
Din Spataj
Din Spataj - avatar
- 2
<html> <head> <title>first page</title> </head> <body> <div align="center"><img src="http://www.sololearn.com/images/tree.jpg" alt="Image is loading"/> </div> </body> </html>
16th Mar 2017, 7:39 AM
Atiqa Ijaz Khan
Atiqa Ijaz Khan - avatar