Phantom space between images

This is a discussion on "Phantom space between images" within the Starting Out section. This forum, and the thread "Phantom space between images are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Starting Out

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 2nd, 2007, 23:31
Reputable Member
Join Date: Jul 2007
Location: UK
Posts: 108
Thanks: 2
Thanked 1 Time in 1 Post
Phantom space between images

I seem to be having some trouble discovering why in blazes there is a space after my first image in a table cell, the image itself does not contain a space and if I switch the images around it is always the first one on the line that has a space after it. Nnnnnnnggg! Please anyone, if you can spot something in my code that's causing this or have another suggestion, do tell

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    
  <title>Wildlife Photography</title>
</head>

<body bgcolor="#003300" text="#000000" link="#ff99cc" vlink="#6600ff" leftmargin=0 rightmargin=0 topmargin=0>

<table border="1" cellpadding="0" cellspacing="0" bgcolor="#003300" align="right">

      <tr>
          <td>
              <img alt="Index" border="0" align="top" src="images/cloudscape_ladybirdcone.jpg">
          </td>         
      </tr>
      
      <tr>
        <td>
            <img alt="Insects" border="0" align="top" src="images/bt_insects.png">
            <img alt="Animals" border="0" align="top" src="images/bt_animals.png">
        </td>
    </tr>
    
  
</table>

</body>
</html>
Also I have a question about the use of topmargin etc, Validator tells me it's wrong so is there an equivalent I should be using (to remove the borders to the browser window edge)?
Reply With Quote

  #2 (permalink)  
Old Jul 3rd, 2007, 00:41
BGarner's Avatar
Reputable Member
Join Date: Oct 2006
Location: In front of the computer.
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Phantom space between images

I would not use tables (I would use CSS), but can you give a link so we can see exactly what you're talking about?
Reply With Quote
  #3 (permalink)  
Old Jul 3rd, 2007, 00:44
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Phantom space between images

Not sure what you are trying to do.
You have one image in the top row.
Then two images in the bottom row.
That's why you are getting a space in the top row.

It's hard for me to tell exactly because I don't know the width's of the images.

Can you give more details?
First off.. set some widths and heights on the images.
Reply With Quote
  #4 (permalink)  
Old Jul 3rd, 2007, 08:19
Reputable Member
Join Date: Jul 2007
Location: UK
Posts: 108
Thanks: 2
Thanked 1 Time in 1 Post
Re: Phantom space between images

Quote:
Originally Posted by BGarner View Post
I would not use tables (I would use CSS), but can you give a link so we can see exactly what you're talking about?
OK I've uploaded it here:

http://www.jonathanmortimer.co.uk/test2/test3/test.html

I added in the width and height things as someone suggested but it made no difference. The gap is part of the first img tag in that cell but I can't for the life of me see why it's there.

Is it the table that's causing this? I don't think I ever had this problem with tables before. Perhaps someone could direct me to a good example of this kind of layout using CSS
Reply With Quote
  #5 (permalink)  
Old Jul 3rd, 2007, 11:37
Reputable Member
Join Date: Jul 2007
Location: UK
Posts: 108
Thanks: 2
Thanked 1 Time in 1 Post
Re: Phantom space between images

I tried a different approach using table cells to manage each image, it seems to solve the problem. New version is up at http://www.jonathanmortimer.co.uk/test3/

Just out of interest I tried a page with nothing but the two images and it still produced a small gap to the right of each one, regardless of whether there were just two or ten images. I still don't know what causes it, but I'm sure html/browsers didn't used to do that.
Reply With Quote
  #6 (permalink)  
Old Jul 3rd, 2007, 11:41
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Phantom space between images

Glad you have it sorted out. Table cells are the way to do it IF you are going to use tables.

However you have just experienced one of the downfalls of using tables. You don't have control over spacing like you would if you were using xhtml/css.

I suggest you have a look at the beginner resources, lot of great information on the basics of handcoding.
Reply With Quote
Reply

Tags
image padding space

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ie6 white space under div AndrewChip Web Page Design 1 Jun 11th, 2008 13:15
unwanted space between 2 images Craigj1303 Web Page Design 1 Apr 6th, 2008 12:04
PM Space JacobHaug Webforumz Cafe 12 Oct 1st, 2007 02:47
how to finish the space between images s_mazhar Graphics and 3D 3 Dec 28th, 2005 13:30
Space on table iceytina Web Page Design 6 Dec 11th, 2005 23:38


All times are GMT. The time now is 01:35.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43