6 replies [Last post]
anied52
Offline
newbie
Last seen: 16 years 34 weeks ago
Joined: 2004-02-27
Posts: 6
Points: 0

I have two images that I need to display side by side. I end up with a 4-pixel vertical space between them.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

unwanted spaces between images

Hi anied52,
Have you tried setting the margin to 0;
img{margin:0;}

Hope that helps

anied52
Offline
newbie
Last seen: 16 years 34 weeks ago
Joined: 2004-02-27
Posts: 6
Points: 0

unwanted spaces between images

Yes. I also tried setting {position: relative; left: -4px;}. Same result.

karinne
karinne's picture
Offline
Enthusiast
Aylmer, QC, Canada
Last seen: 13 years 18 weeks ago
Aylmer, QC, Canada
Timezone: GMT-5
Joined: 2004-01-14
Posts: 291
Points: 0

unwanted spaces between images

how about...

img {
  padding: 0;
  margin: 0;
}

do you have a link?

anied52
Offline
newbie
Last seen: 16 years 34 weeks ago
Joined: 2004-02-27
Posts: 6
Points: 0

unwanted spaces between images

Tried it. Same results. Crying

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

unwanted spaces between images

Remove any white space from between the images and provide a link if you are still having problems.

anied52
Offline
newbie
Last seen: 16 years 34 weeks ago
Joined: 2004-02-27
Posts: 6
Points: 0

unwanted spaces between images

That did it! I had both a tab between the opening " and <img> and a \n before the ending ". I had to remove both of them. Thanks.