+ 5
The image will be not displayed in the center
Hello :) I tried to put the image in the middle of the page, but I did something wrong... could you please correct my mistake? <!DOCTYPE html> <html> <head> <title>Pierwszy dzien</title> </head> <body> <p align="center">A nice photo of Kapitan Bomba</p> <img src="https://icdn.2cda.pl/obr/oryginalne/ca7921c47aaa239f592115f13b5b5e4e.jpg" height="300px" width="500px" alt="" align="center"/> </body> </html> The image is on the default (left) site. Thank you and BR! Joan
8 odpowiedzi
+ 6
Joan Bro plz use this css...
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
Maybe the image will align center.🙌🙌🙌
+ 4
https://code.sololearn.com/WULPbCc007hK/?ref=app
Hi! You should use <p> <img/> </p>
After that write in CSS text-align: center;
So now you have image in the center.
P.S. sorry I can t explain in English
+ 4
Joan most wel......🙌🙌🙌🙌
+ 2
I checked on W3 vlidation website and they offered the same solution - use css, but I just have started with html and want to learn it step by step. I have the same problem with each atribute (I mean, the align doesn't work, ofcourse except text), so I think I really have to add css...
Thank you guys for your time!
+ 1
La propiedad para centrar tu imagen se la debes de poner a <body> para que asi todo su contenido quede centrado en la pantalla
+ 1
Hello Anwar :)
Could you please explain it detail / share some URL to an article about it?
+ 1
Hello Joan Wick look here this help page I hope and you can use something
http://www.psdahtmlpasoapaso.com/blog/como-centrar-imagen-html-vertical-y-horizontal/