Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Small problem with image alignment

IM writing a small html web page contain several pictures but I can not get the pictures to align correctly. When I write the code and run it in the browser it will leave a copy of the picture at the left and place one to the right(or middle) slightly overlapping and just a little offset. IV tried the center alignments as well as the tags. Here is the code without any alignment set. Thanks




image


image


image


image


image





Comments

  • Don McCunnDon McCunn Posts: 2Member
    [b][red]This message was edited by Don McCunn at 2004-12-10 10:1:53[/red][/b][hr]
    Tables are the best way to align your images. Use a cell for each image then start a row when you want your image to appear vertically down the page. You can use
    inside tables. If you want the rule to occupy the full width of the page, set the table width to 100% . When you use tables, they are cross browser compatible.

    : IM writing a small html web page contain several pictures but I can not get the pictures to align correctly. When I write the code and run it in the browser it will leave a copy of the picture at the left and place one to the right(or middle) slightly overlapping and just a little offset. IV tried the center alignments as well as the tags. Here is the code without any alignment set. Thanks
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
  • WeirdofreakWeirdofreak Posts: 439Member
    Using tables for something like this is overkill.

    I don't quite get what the problem is, but that code should work fine. If the images are overlapping a bit it sounds like they're inline, but without a doctype putting you in strict mode they get rendered as block-level. You could try setting them to be block-level with the CSS
    img { display: block; }
    But that might not be the problem at all.

    It works fine for me in Firefox; I don't have IE (which I assume you're using) so I can't test it in that but it certainly seems like it should work. Is that your entire code, or did you trim it for legibility?
    ^D
    $ shameless-plug
    http://line-ed.sourceforge.net

Sign In or Register to comment.