Re: Centering image on page?

Discussion in 'HTML' started by Richard, Jun 25, 2003.

  1. Richard

    Richard Guest

    "Lorne Cameron" <> wrote in message
    news:3ef9b95b$...
    > 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.
    Richard, Jun 25, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry Camel

    Centering an image with text

    Jerry Camel, Sep 23, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    532
    John Timney \(ASP.NET MVP\)
    Sep 23, 2005
  2. Jerry Muelver

    Re: Centering image on page?

    Jerry Muelver, Jun 25, 2003, in forum: HTML
    Replies:
    0
    Views:
    833
    Jerry Muelver
    Jun 25, 2003
  3. mr_vocab
    Replies:
    4
    Views:
    691
    mr_vocab
    May 24, 2004
  4. Samuël van Laere

    Image centering

    Samuël van Laere, Dec 5, 2004, in forum: HTML
    Replies:
    4
    Views:
    520
    David Dorward
    Dec 5, 2004
  5. Steve Greenaway

    Something about image centering

    Steve Greenaway, Dec 5, 2004, in forum: HTML
    Replies:
    3
    Views:
    412
    David Dorward
    Dec 5, 2004
Loading...

Share This Page