Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Apr 2005
    Location
    Hatfield, England
    Posts
    855
    Member #
    9790
    I want to align an image in the centre of my webpage using only html. I cannot find a command to do it. The image is at the top of my page and i just want it to be centred in the middle of the page.

  2.  

  3. #2
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    put this code around the image:

    HTML Code:
    <div align="center"><"image code here"></div>

  4. #3
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Not sure but I think that will only work in IE.

    Code:
    <div align="center">
    <div style="margin: 0 auto;">
    <"image code here")
    </div>
    
    That should work in IE and Firefox.
    </div>

  5. #4
    Senior Member Trico's Avatar
    Join Date
    Feb 2004
    Location
    Nottingham, UK
    Posts
    894
    Member #
    5081
    Code:
    <img src="location/pic.jpg" width="(xx)" alt="" style="margin: o auto;" />
    or

    Code:
    <center>
    <img src="location/pic.jpg" align="center" alt="">
    </center>
    Depends if you're bothered about web standards, many methods now at least use a small snippet of CSS.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:37 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com