Urgent HTML question

Author
Discussion

Stamp

Original Poster:

3,583 posts

236 months

Sunday 11th May 2008
quotequote all
I an building a very quick web site and I have a gif image inserted at the top of the page.
The code is..
<img src="web.gif" width="975" height="601" alt="My Pic">

How do I centre this on the page?

grumbledoak

31,535 posts

233 months

Sunday 11th May 2008
quotequote all
You'll be wanting align=center (or the equivalent in CSS). Not sure you can put that straight on the image, you might need to put the image within something else (e.g. a paragraph) and 'align' that.

HTH. And not in the usual sense!

grumbledoak

31,535 posts

233 months

Sunday 11th May 2008
quotequote all
This'll tell you the current 'correct' way to do it: http://www.w3.org/TR/html401/present/graphics.html

By the look of it, you can put it on the IMG tag.

LukeBird

17,170 posts

209 months

Sunday 11th May 2008
quotequote all
<div align='center'><img src="web.gif" width="975" height="601" alt="My Pic"></div>

That'll do it smile

ETA I like my images in divs!

Edited by LukeBird on Sunday 11th May 19:08

Stamp

Original Poster:

3,583 posts

236 months

Sunday 11th May 2008
quotequote all
Great, thanks Luke.

LukeBird

17,170 posts

209 months

Sunday 11th May 2008
quotequote all
Stamp said:
Great, thanks Luke.
No problem! thumbup
Hope it worked ok!