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.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Junior Member
    Join Date
    Apr 2003
    Posts
    2
    Member #
    1182
    hey guys,
    don't know if this has been discussed before, but it's driving me insane, so i thought i'd ask if anyone had a) experienced this before or b) found a really good solution (like a stylesheet option or something).

    basically i have two images one above the other. this code renders fine in IE6 (6.0.2600):
    <a href="#"><img style="border: 0" src="image1.jpg"></a><br>
    <a href="#"><img style="border: 0" src="image2.jpg"></a>

    However, this code renders with a small white space between the images:

    <a href="#">
    <img style="border: 0" src="image1.jpg">
    </a><br>
    <a href="#"><img style="border: 0" src="image2.jpg"></a>

    Can anyone verify this? I've seen it happen on 3 systems running this version of IE6 now, and I don't have any other browsers to test it on at the moment.

    Any thoughts?

    Johan

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    put them on the same line, that should work i think
    JR

  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    What jravenscroft said. It's not actually a bug that's confined to IE6. Other browsers (can we all say Netscape 4.7?) have a bad habit of putting in whitespace when images and their bounding elements are put on separate lines or separated with spaces.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    It's actually not a bug at all. It's a desired behaviour of HTML, as defined by http://www.w3c.org.

    The reasoning behind the "white space" is that linebreaks in HTML are registered as spaces in the rendered page. How would you expect the following to appear (assuming no spaces, only line breaks):
    Code:
    <html>
    <body>
    This
    is
    a
    test
    </body>
    </html>
    The obvious answer is "This is a test". Because line breaks are registered as spaces in the rendered html, they will be rendered as spaces between images as well. The only way to remove the space is to place the close of one image and the opening of the next immediately adjacent in the source, like this:
    Code:
    <img src="img1.gif"><img src="img2.gif">
    
    or
    
    <img src="img1.gif"><
     img src="img2.gif">
    FrontPage used to be notorious for creating HTML like the second example above. It can be extremely confusing to read.

    The preferred method of creating "spliced" images is to combine them in a table, which eliminates the need to place them all together. Splicing images in a table can be accomplished like so:
    Code:
    <table cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td><img src="img1.gif"></td>
            <td><img src="img2.gif"></td>
        </tr>
        <tr>
            <td><img src="img3.gif"></td>
            <td><img src="img4.gif"></td>
        </tr>
    </table>
    
    or
    
    <table cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td>
                <img src="img1.gif"><br>
            </td>
            <td><
                img src="img2.gif"><br>
            </td>
        </tr>
        <tr>
            <td>
                <img src="img3.gif"><br>
            </td>
            <td>
                <img src="img4.gif"><br>
            </td>
        </tr>
    </table>
    The second example shows a <br> after each image. This is to prevent the addition of an undesired "white space" after the image in the cell, which is another HTML behaviour with images. If you're going to structure your HTML heirarchically (as in the second example above), always remember your breaks!!!

  6. #5
    Junior Member
    Join Date
    Apr 2003
    Posts
    2
    Member #
    1182
    great, thanks a lot for your responses. i suppose i will just have to be more careful when it comes to hitting enter in html code ;-)

    Johan

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    It is pretty frustrating though...HTML is the only "language" that I know of where whitespace actually matters. I can't tell you how many templates here that form WDF had to be one massive ugly line because of this.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    im not sure if this has anything to do with it but in netscape there is a big gap above the 'want to sponsor a contest' graphic and also the want to donate a different amount graphic is on the same line as the copyright info

    god i hate netscape, glad i don't have to use it anymore - i pity the people that do
    JR

  9. #8
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Netscape 4 completely breaks WDF anyway. Mozilla 1.3a does a surprisingly good job, as does Safari.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  10. #9
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    it was netscape 7 and it looks the same as mozilla, i checked just them 2 minor issues. I wouldn't have a clue about netscape 4 because i haven't got it and have no intentions of getting it either
    JR

  11. #10
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    I was on a Mac last night (I'll check the IE version #) and on the home page, the part at the top that says "Welcome back [name]" was overlapped by the tip of the day. I couldn't click on the "view threads posted since last visit" link.


Page 1 of 2 1 2 LastLast

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 06:42 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com