469,923 Members | 1,458 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

Relative position of image - how to remove gap

Hi,

My situation is i have a jpg on a webpage and want to overlay a png
over the top of it (which has transparent pixels, so bits of the jpeg
come through. I am doing this like this :

<img style="position:relative; TOP:180px; LEFT:150px;
WIDTH:50px; HEIGHT:50px" border="0" src="image1.png">
<img src="big_image.jpg"/>

Which is all ok (ive applied a fix to make png transparency work in
IE6), only there is a gap, where the png would naturally sit in the
flow of the document is consuming space even though its not there
anymore.

Is there anyway of collapsing this gep doen to nothing?
thanks,

Paul

Dec 14 '06 #1
1 8695
Hi,

Ive found a solution in case this helps anyone else, its probably not
the most elegent solution :

<img style="position:relative; TOP:0px; LEFT:380px; WIDTH:50px;
HEIGHT:50px; margin-right:-50px" border="0" src="3year-guarantee.png">

<img border="0" src="bmw1.jpg" width="440" height="330">

but ive basically added a negative right margin to the png, same value
as its width, so it is in effect not taking up any space.
pa**********@gmail.com wrote:
Hi,

My situation is i have a jpg on a webpage and want to overlay a png
over the top of it (which has transparent pixels, so bits of the jpeg
come through. I am doing this like this :

<img style="position:relative; TOP:180px; LEFT:150px;
WIDTH:50px; HEIGHT:50px" border="0" src="image1.png">
<img src="big_image.jpg"/>

Which is all ok (ive applied a fix to make png transparency work in
IE6), only there is a gap, where the png would naturally sit in the
flow of the document is consuming space even though its not there
anymore.

Is there anyway of collapsing this gep doen to nothing?
thanks,

Paul
Dec 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Ken Kast | last post: by
2 posts views Thread by Stephen Weatherly | last post: by
4 posts views Thread by boclair | last post: by
6 posts views Thread by Gérard Talbot | last post: by
3 posts views Thread by Justin England | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.