Centering images in HTML (Help Please)

Discussion in 'Mac Apps and Mac App Store' started by jethroted, May 8, 2003.

  1. jethroted macrumors 6502a

    jethroted

    Joined:
    Jan 2, 2003
    Location:
    Cyberspace
    #1
    First I would like to say I am not a web designer at all. I am just trying to get a small page up for my mom. Anyways I am just trying to get a banner at the top of the page to center itself. This would seem to be a very simple thing to do, however, it has proven to be frustrating. I know this is probably basic html, but if I don't know it, then what can I do, right? :confused:
     
  2. jMc macrumors 6502

    jMc

    Joined:
    Nov 19, 2001
    Location:
    London N8, Late-16th Century
    #2
    Well, the easiest, though not necessarily the best, way to do it would be to wrap the img tag in a <center></center> tag...
    <center><img src="blahblahblah"></center>
    jx
     
  3. jethroted thread starter macrumors 6502a

    jethroted

    Joined:
    Jan 2, 2003
    Location:
    Cyberspace
    #3
    :( That did not work for me.
     
  4. jMc macrumors 6502

    jMc

    Joined:
    Nov 19, 2001
    Location:
    London N8, Late-16th Century
    #4
    hmmm, can you post the relevant piece of code you're using here? i can't see why that shouldn't work. are you using tables at all or using 'align' variables in any of your tags?
    jx

    edit: try <p align=center><img src="blahblahblah"></p>
     
  5. MorganX macrumors 6502a

    MorganX

    Joined:
    Jan 20, 2003
    Location:
    Midwest
    #5
    Make sure that the image you are centering is cropped the way you think it is. (i.e. white space for transparent spaces around the pic may make it appear to be off center.)

    If you are placing it in a table align the cell.

    Also try <img src=blah.gif align="center">. This may be IE only.
     
  6. bertagert macrumors 6502

    Joined:
    Jan 13, 2003
    #6
    <center><img src="blahblahblah"></center> will work for you just fine.

    I think you should do this first:

    Add width and height to your img tag: <img src="blahblahblah" width="200" height="200"> (or what ever your actual picture size is)

    second: make sure you have the right path for your image. For example:

    <img src="picture.jpg"> or <img src="images/picture.jpg">

    Also, where are you testing this out? Locally or are you uploading to the web server? If you coding by hand and testing on the web server, make sure you upload the image to the server. If your testing locally, make sure have the correct path to your image in the img tag.
     
  7. jethroted thread starter macrumors 6502a

    jethroted

    Joined:
    Jan 2, 2003
    Location:
    Cyberspace
    #7
    Thanks Guys! The <center> thing did work out in the end. The problem was that originally the image was in a table, and that was causing my problems.
     
  8. bennetsaysargh macrumors 68020

    bennetsaysargh

    Joined:
    Jan 20, 2003
    Location:
    New York
    #8
    HTML Help

    a good site for html codes and stuff like that is http://funky-chickens.com/

    just wanna throw that into the mix of things.
     

Share This Page