/    Sign up×
Community /Pin to ProfileBookmark

divs taking up space

I’m attempting to place two relatively large images on top of each other in a very tight space. he images are about 200x200px and they need to fit in a table cell that’s about that size. The problem I’m having is that one of the divs the images are in is occupying a 200x200px space below where I have the images actually placed. Ok, that’s a terrible description. Let me try to say that another way. The first div with the image in it is placed perfectly. By default, the second div gets placed below it. I have to set the ‘top’ property to -200px to get the second image placed on top. The problem is, the second div element still reserves the space below the first div even though I’ve moved it up 200px. Is there any way to get around this so I can fit both elements on top of each other in such a tight space? I tried making them inline divs, but the problem shifts to a horzontal one instead of a vertical one. I may be able to get away with that in the design, but NS6+ crops the images in this case no matter how I set the height and width values of either the div or images. Has anybody else run across this annoying feature?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisMar 10.2003 — Try this:<table border>
<tr>
<td style="position: relative">
<img src="lilguy2.gif" height=200 width=200>
<div id="d2" style="position: absolute; top: 0px; left: 0px"><img src="cancel.gif" height=200 width=200></div>
</td>
</tr>
</table>
Copy linkTweet thisAlerts:
@bisquiauthorMar 10.2003 — I was just about to post, you beat me to it. I actually fixed the problem by placing one image directly in the table cell and another in an absolute div outside of the table. Looks like it works in all browsers. Thanks for the help!
×

Success!

Help @bisqui spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...