Center an image

Discussion in 'HTML & Website Design' started by terminator69, Dec 4, 2007.

  1. #1
    <img src="URL"

    what is the code to center an image in the middle of a page?

    align="middle" won't work..
     
    terminator69, Dec 4, 2007 IP
  2. kewlchat

    kewlchat Well-Known Member

    Messages:
    1,779
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    110
    #2
    I always just use <center> </center> on the outside of the image tags.
    Or mabye something like
    <DIV ALIGN=CENTER>
    your image stuff here
    </DIV>

    or either use css..

    If they dont work for ya try
    <style>
    img.mycenter {margin-left:auto; margin-right:auto; display:block; text-align:center;}
    </style>

    <img class="mycenter" src="....." height="...." width="....">

    Hope one works for ya:)

    Ohh heres another way too for banners and stuff <H1 ALIGN=center><IMG SRC="logo.gif" ALT="Welcome to Whatever"></H1>
     
    kewlchat, Dec 4, 2007 IP
  3. terminator69

    terminator69 Notable Member

    Messages:
    4,872
    Likes Received:
    260
    Best Answers:
    0
    Trophy Points:
    230
    #3
    thanks i just used the <centre> tags and it worked.
     
    terminator69, Dec 4, 2007 IP