Why does not image appear at the center of page, even though we use align="center" in the following code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

Why does not image appear at the center of page, even though we use align="center" in the following code?

However, if we change it with align="right", the image is placed on the right side of the page. https://code.sololearn.com/WpMMQoqz8sFq/?ref=app

29th Jan 2018, 7:34 PM
Iman Abbaszadeh
Iman Abbaszadeh - avatar
3 Answers
+ 7
<p align="center"> <img src="http://www.sololearn.com/images/tree.jpg" height="150px" width="150px" border="1px" alt="" /> </p>
29th Jan 2018, 7:40 PM
Daniel
Daniel - avatar
+ 8
Its not work. You must to do that with CSS or putting image tag into a DIV or P for example
29th Jan 2018, 7:39 PM
Daniel
Daniel - avatar
+ 5
Tnx
29th Jan 2018, 7:43 PM
Iman Abbaszadeh
Iman Abbaszadeh - avatar