Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: Centering image on page?

Reply
Thread Tools

Re: Centering image on page?

 
 
Richard
Guest
Posts: n/a
 
      06-25-2003

"Lorne Cameron" <(E-Mail Removed)> wrote in message
news:3ef9b95b$(E-Mail Removed)...
> I'm redesigning the gallery on my site so that when a thumnail is
> clicked, an HTML page is generated containing the image centered on the
> page. I have it working just using a few <BR>s and <CENTER> tags, but
> I'd like it to be truely centered both horizontally and vertically. So
> I tried having a table with WIDTH and HEIGHT at 100%, with
> ALIGN="center" and VALIGN="middle". It works fine when the image is
> small enough to fit in the window, but when it has to be resized it
> leads to problems. Here's what I have so far (border is inplace just
> now so that I can see what is happening - the extra height/width added
> by the border is negligable and is not the cause of the problem):
>


FWIW, I'd lose the document.write altogether for the table. Not needed.
<table><tr align="center" valign="middle"><td align="center"
valign="middle">
<img src="name.jpg" height="x00" width="x00">
</td></tr></table>

Where x could theoretically be the same and the image would adjust
accordingly.
So that if x was not the image size, it would still be sized in the same 4x3
format.
For thumbnails, 200x200 seems to work out just fine.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centering an image with text Jerry Camel ASP .Net 6 09-23-2005 10:12 PM
Something about image centering Steve Greenaway HTML 3 12-05-2004 07:57 PM
Image centering SamuŽl van Laere HTML 4 12-05-2004 07:04 PM
Centering an image for any resulition mr_vocab HTML 4 05-24-2004 06:13 AM
Re: Centering image on page? Jerry Muelver HTML 0 06-25-2003 08:27 PM



Advertisments