By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,917 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,917 IT Pros & Developers. It's quick & easy.

Remove space between images

P: n/a
Hi

I'd like to discuss the following problem: How to remove the space
between two images (img)?

<img alt="First" src="first.gif">
<img alt="Second" src="second.gif">

I tried:

<style>
* {
padding: 0;
margin: 0;
border: none;
}
</style>

However, the effect is none. There remains a space between the images.

Anybody resolved this problem?

Thanks in advance.
Daniel Frey
Jul 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Sometime around 3 Nov 2003 14:31:13 -0800, Daniel is reported to have
stated:
Hi
G'day.

I'd like to discuss the following problem: How to remove the space
between two images (img)?

<img alt="First" src="first.gif">
<img alt="Second" src="second.gif">


<img alt="First" src="first.gif"><img alt="Second" src="second.gif">

HTH

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 20 '05 #2

P: n/a
Daniel wrote:
I'd like to discuss the following problem: How to remove the space
between two images (img)?

<img alt="First" src="first.gif">
<img alt="Second" src="second.gif">


<img alt="First" src="first.gif"><img alt="Second" src="second.gif">

--
Spartanicus
Jul 20 '05 #3

P: n/a
<img alt="First" src="first.gif" hspace="0" vspace="0" align="left" />
<img alt="Second" src="second.gif" hspace="0" vspace="0" align="left" />

"Daniel" <da*********@switzerland.org> wrote in message
news:24**************************@posting.google.c om...
Hi

I'd like to discuss the following problem: How to remove the space
between two images (img)?

<img alt="First" src="first.gif">
<img alt="Second" src="second.gif">

I tried:

<style>
* {
padding: 0;
margin: 0;
border: none;
}
</style>

However, the effect is none. There remains a space between the images.

Anybody resolved this problem?

Thanks in advance.
Daniel Frey

Jul 20 '05 #4

P: n/a
"Daniel" <da*********@switzerland.org> schrieb im Newsbeitrag
news:24**************************@posting.google.c om...
Hi

I'd like to discuss the following problem: How to remove the space
between two images (img)?

<img alt="First" src="first.gif">
<img alt="Second" src="second.gif">

I tried:

<style>
* {
padding: 0;
margin: 0;
border: none;
}
</style>


Try this (not tested):

<style>
img {
padding: 0px;
margin: 0px;
display:block;
}
</style>

--
Markus
Jul 20 '05 #5

P: n/a

"Daniel" <da*********@switzerland.org> wrote in message
news:24**************************@posting.google.c om...
Hi

I'd like to discuss the following problem: How to remove the space
between two images (img)?

<img alt="First" src="first.gif">
<img alt="Second" src="second.gif">


Hint: If you have the following HTML code:

<p>HEL
LO</p>

it would appear as HEL LO in a browser, not as HELLO. If you want HELLO, you
have to have

<p>HELLO</p>

Jul 20 '05 #6

P: n/a
Harlan Messinger wrote:
"Daniel" <da*********@switzerland.org> wrote in message
news:24**************************@posting.google.c om...
Hi

I'd like to discuss the following problem: How to remove the space
between two images (img)?

<img alt="First" src="first.gif">
<img alt="Second" src="second.gif">

Hint: If you have the following HTML code:

<p>HEL
LO</p>

it would appear as HEL LO in a browser, not as HELLO. If you want HELLO, you
have to have

<p>HELLO</p>

HACK:

<style type="text/css" media="screen">
p span{
display:block;
float:left;
}
</style>

<p><span>HEL</span>
<span>LO</span></p>

Also possible with images, though it doesn't work correctly in older
browsers, especially the ones that don't get CSS.

--
Anne van Kesteren
http://www.annevankesteren.nl/
Jul 20 '05 #7

P: n/a

"Anne van Kesteren" <ma**@annevankesteren.nl> wrote in message
news:bo**********@reader11.wxs.nl...
Harlan Messinger wrote:
"Daniel" <da*********@switzerland.org> wrote in message
news:24**************************@posting.google.c om...
Hi

I'd like to discuss the following problem: How to remove the space
between two images (img)?

<img alt="First" src="first.gif">
<img alt="Second" src="second.gif">

Hint: If you have the following HTML code:

<p>HEL
LO</p>

it would appear as HEL LO in a browser, not as HELLO. If you want HELLO, you have to have

<p>HELLO</p>

HACK:


[hack snipped]

Why would someone use a hack instead of just fixing his code?

If the idea is to prevent long lines without breaks (for example, if there
were twenty images instead of two), then this works:

<img
alt="First" src="first.gif"<img alt="Second" src="second.gif"


This may look odd to HTML coders, but it's a common programming style for
handling long lines of code.

Jul 20 '05 #8

P: n/a
Harlan Messinger wrote:
Why would someone use a hack instead of just fixing his code? I think nobody would do that :-)
If the idea is to prevent long lines without breaks (for example, if there
were twenty images instead of two), then this works:

<img
alt="First" src="first.gif"
><img

alt="Second" src="second.gif"
>


This may look odd to HTML coders, but it's a common programming style for
handling long lines of code.

Just wanted to show it _is_ possible. It was not my intention to
recommend this. That was also the reason I responded to your suggestion
and not to Daniel's question ;-)

--
Anne van Kesteren
http://www.annevankesteren.nl/
Jul 20 '05 #9

P: n/a
Thanks to all. It basically solved my problem.
Daniel
Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.