+ 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
7 Answers
+ 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>
+ 1
You will need to use css to do that man.
+ 1
thank you for your answer my friend đđ
+ 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>
+ 1
to put in center anything , this is the code <p align="center"> <imag sec=" imag.jpg alt/> </p align="center">
+ 1
You can try align tag
0
thank you my friends.. your answers were very helpful