+ 1

how can i set the image in the center of the web page

please help!! how can i move the image to the center of the page i tried align="center" it doesn't work

25th Sep 2016, 6:50 PM
Boseka
Boseka - avatar
7 Respostas
+ 3
this is the correctly away for all of things to put them in center of page horizontally . <html> <head> <title>first page</title> </head> <body> <p align="center"> <img src="http://www.sololearn.com/images/tree.jpg" height="150px" width="150px" alt="" /> </p align="center"> </body> </html>
26th Sep 2016, 1:46 PM
edmond kendella
+ 1
You will need to use css to do that man.
25th Sep 2016, 7:12 PM
Luiz Fernando
Luiz Fernando - avatar
+ 1
thank you for your answer my friend 😀😉
25th Sep 2016, 7:14 PM
Boseka
Boseka - avatar
+ 1
Try the below code, to centre an image on a page encapsulated in a div (block element). Also this code is responsive to different screen sizes. <!DOCTYPE html> <html> <head> <title>Example</title> <style type="text/css"> .wrapper { max-width: 900px; margin: 0 auto; } .imgContainer { text-align: center; } .img1 { max-width: 100%; } </style> </head> <body> <h1>Heading</h1> <div class="wrapper"> <div class="imgContainer"> <img class="img1" src="example.jpg"> </div> </div> </body> </html>
25th Sep 2016, 8:18 PM
Baillie O'grady
Baillie O'grady - avatar
+ 1
to put in center anything , this is the code <p align="center"> <imag sec=" imag.jpg alt/> </p align="center">
26th Sep 2016, 1:40 PM
edmond kendella
+ 1
You can try align tag
27th Sep 2016, 10:14 AM
Raghav Gupta
Raghav Gupta - avatar
0
thank you my friends.. your answers were very helpful
26th Sep 2016, 3:37 PM
Boseka
Boseka - avatar