workflow80
asked on
how to center an image
Hi
I want to center an image . Here is part of my code :
<body>
test
<div><img src="image.jpg" align="center"> </div>
</div>
It is always on the left. I want the image in the center of my html page.
Thanks for your help
I want to center an image . Here is part of my code :
<body>
test
<div><img src="image.jpg" align="center"> </div>
</div>
It is always on the left. I want the image in the center of my html page.
Thanks for your help
try this
<div style="width: 50%; margin: auto;"><img src="image.jpg"></div>
Maybe for kicks and giggles....
Add :
align to the div:
<body style="margin:0 auto;padding:0;">
test
<div align="center"><img src="image.jpg" align="center"> </div>
</div>
Add :
align to the div:
<body style="margin:0 auto;padding:0;">
test
<div align="center"><img src="image.jpg" align="center"> </div>
</div>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oh and btw - I built a head and closed the body and head in my test, just to make sure it was reading it proper. Just FYI.
<body style="margin:0 auto;padding:0;">
test
<div><img src="image.jpg" align="center"> </div>
</div>