how to display images without gap

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mayormel
    New Member
    • Oct 2007
    • 16

    how to display images without gap

    Hi!
    im unable to make the images displayed beside each other wihtout gaps.

    this is my code:
    [html]
    <table width=600 hight=800>
    <tr>
    <td>
    <a href="Images/bg2.gif" target="_blank" > <img src=Images/pic2.jpg></a>

    <a href="Images/bg2.gif" target="_blank" > <img src=Images/pic2.jpg></a>

    <a href="Images/bg2.gif" target="_blank" > <img src=Images/pic2.jpg></a>
    </td></tr>
    </table>
    [/html]
    but in the output the images have space inbetween. is there a way to put them without any space . thx
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    This happens because images are always inline, just like text, and create 'inline boxes'. So you have to simply change the property of the div to 'display:block' . The only problem is that block level elements occupy the full width of the page so 'float:left' will keep them on the same line.

    Comment

    • mayormel
      New Member
      • Oct 2007
      • 16

      #3
      Originally posted by drhowarddrfine
      This happens because images are always inline, just like text, and create 'inline boxes'. So you have to simply change the property of the div to 'display:block' . The only problem is that block level elements occupy the full width of the page so 'float:left' will keep them on the same line.

      thx for ur help. it works for the top and bottom images, but the image on the horizontal level still have gabs. i don know how to resolve this.

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        Well, it shouldn't, so post a link or your markup.

        Comment

        • JamieHowarth0
          Recognized Expert Contributor
          • May 2007
          • 537

          #5
          Hi there,

          Try using:
          [code=html]
          <table style="border:0 px;padding:0px; margin:0px;">
          [/code]

          Normally works for me. Hope it helps!

          Best regards,

          medicineworker

          Comment

          • mayormel
            New Member
            • Oct 2007
            • 16

            #6
            Originally posted by medicineworker
            Hi there,

            Try using:
            [code=html]
            <table style="border:0 px;padding:0px; margin:0px;">
            [/code]

            Normally works for me. Hope it helps!

            Best regards,

            medicineworker

            thx for all ur help.

            Comment

            • drhowarddrfine
              Recognized Expert Expert
              • Sep 2006
              • 7434

              #7
              Well, there you go, and me spouting off on the other stuff and not paying attention to the fact that the images are in a table. My advice applies to non-table images (not that I would ever lay a page out using tables :) ).

              Comment

              • JamieHowarth0
                Recognized Expert Contributor
                • May 2007
                • 537

                #8
                Originally posted by drhowarddrfine
                Well, there you go, and me spouting off on the other stuff and not paying attention to the fact that the images are in a table. My advice applies to non-table images (not that I would ever lay a page out using tables :) ).
                Lol - even the W3C Schools' website uses tables for layout (which technically isn't a conformity to their own WAIA standards, as you're really meant to use <div>'s - but everyone knows that... don't they... like I do on my website *cough* not *cough* 8-)).

                medicineworker

                Comment

                • drhowarddrfine
                  Recognized Expert Expert
                  • Sep 2006
                  • 7434

                  #9
                  W3CSchools is in no way affiliated with the W3C.

                  Comment

                  • JamieHowarth0
                    Recognized Expert Contributor
                    • May 2007
                    • 537

                    #10
                    Originally posted by drhowarddrfine
                    W3CSchools is in no way affiliated with the W3C.
                    My apologies, you are correct (W3 Schools is (c) Refsnes Data).
                    My boo-boo.

                    med

                    Comment

                    • jadedchron
                      New Member
                      • Feb 2008
                      • 1

                      #11
                      The reason as mentioned above (as I recently found out) is because you have your linked images on separate lines of the HTML. Put them all on the same line w/out the breaks in the code. OR you can use display:inline for the img.

                      Comment

                      Working...