www.webdeveloper.com
Results 1 to 6 of 6

Thread: whitespace below or above image in td

  1. #1
    Join Date
    Sep 2009
    Posts
    3

    resolved whitespace below or above image in td

    here is the page: http://www.rockymountainmetal.com/test/home.html

    problem:
    Internet Explorer displays a huge whitespace above the image.
    Firefox and Safari shows no whitespace.

    HTML:
    <td width="420" height="170" style="vertical-align:bottom;"><img src="images/logo1.jpg" width="420" height="170"></td>

    *if i change vertical-align to :top, then the same whitespace appears below the image.


    CSS:
    img {
    display:block;
    margin:0;
    }

    please help, I have been searching and trying to figure this out for hours!
    Last edited by WebJoel; 09-01-2009 at 09:41 PM.

  2. #2
    Join Date
    Aug 2006
    Posts
    1,897
    You always want to start by validating your code. If it doesn't "compile", then you're taking your chances already.

    Dave

  3. #3
    Join Date
    Sep 2009
    Posts
    3
    ok i have validated my code, same problem exists, what do i do now?

  4. #4
    Join Date
    Aug 2006
    Posts
    1,897
    The issue is that your "left" column (actually the second column in the table) is shorter than the "right" (fourth) column in the table. If you add some <br> lines at the end of that second column (below Elk Square...) you can see the white space disappear. This is one of the disadvantages of doing layouts with tables, I suppose.

    Dave

  5. #5
    Join Date
    Sep 2009
    Posts
    3
    wow such a simple fix after many hours of headache

    thank you so much!

  6. #6
    Join Date
    Dec 2005
    Location
    American, living in Toronto, ON. CANADA
    Posts
    6,746
    Whenever I read about 'little white space' in TD cells, I think "border-collapse" but since the problem seems resolved, I won't bother testing your site with this. Read the following:

    http://www.w3schools.com/Css/pr_tab_border-collapse.asp
    I build for: Firefox and tweak for IE

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles