How do I center a picture on a web page

geeta_m9
geeta_m9 used Ask the Experts™
on
I have a picture which I would like to center at the top of a web page. However, when I insert the picture, it is automatically left justified on the page. How do I adjust it so that it lies in the center of the page? Would I need to use a table to accomplish this? If so, can you show me how? Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Lead Developer
Commented:
you can do it the same way you would center text

http://www.w3schools.com/css/tryit.asp?filename=trycss_text-align_all
HainKurtSr. System Analyst
Commented:
try:

<div align=center>
<img src=x.gif>
</div>

Author

Commented:
Both the solutions work, thanks!

Geeta

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial