473,503 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overlapping Images

I have 2 rectangle images. 1 with a box in the upper left corner and
the other with a box in the lower right hand corner. Both images are
the same size.

I would like to display these 2 images so that it looks like 1 image by
overlapping them using css.

I have tried creating a seperate div for each image and setting the
top/left the same on both and changing the layer on each. This only
made the 2nd one display directly below the first image.

I would also like for the combined image to stretch to the width of the
screen and stretch the height porportionally to the width.

Is this possible? Please help. Thanks!

Jul 21 '05 #1
1 12882
I've never tried to stretch images in the way you describe so I won't
comment on that (tho' I wouldn't give much for your chances of it looking
good!).

To overlap 2 images, I'd do this:

Create a "container" div with positioning set to "relative" but with no
offsets given. This has the effect of calculating "absolute" positioning
(which I'd use for the images) from the position of this div. Otherwise
it'll be calculated from the <body> tag.

Then I'd simply add CSS ids to the <img> tags and position them absolutely
with offsets for left and top (right and bottom are inconsistently rendered
by browsers). Wrap them in their own divs (absolutely positioned) if you
wish.

You could also use relative positioning on one of the images to move it, but
space will be allocated for it in its "normal" place, so you may find a
"hole" where you'd have wanted other elements to appear.

--
####################
## PH, London
####################
"Mitch" <mh********@adelphia.net> wrote in message
news:11********************@f14g2000cwb.googlegrou ps.com...
I have 2 rectangle images. 1 with a box in the upper left corner and
the other with a box in the lower right hand corner. Both images are
the same size.

I would like to display these 2 images so that it looks like 1 image by
overlapping them using css.

I have tried creating a seperate div for each image and setting the
top/left the same on both and changing the layer on each. This only
made the 2nd one display directly below the first image.

I would also like for the combined image to stretch to the width of the
screen and stretch the height porportionally to the width.

Is this possible? Please help. Thanks!

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4648
by: Max M | last post by:
I am writing a "find-free-time" function for a calendar. There are a lot of time spans with start end times, some overlapping, some not. To find the free time spans, I first need to convert the...
3
12786
by: Phil Sandler | last post by:
All, I have a table with start and end dates/times in it, and would like to be able to calculate the number of hours represented, accounting for overlapping records. Note that I am looking...
2
12009
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references...
3
4533
by: Fahad Aijaz | last post by:
Can any one tell me how can I create overlapping images using ASP.NET. That is, One rectangle drawn as a background image and then another image is placed over it. If the upper image gets...
4
3226
by: Charlie Brown | last post by:
I have a form with 2 custom controls that can be dragged around by a user. How can I check if they overlap each other without performing some kind of Collision detection on them? Is there...
4
4848
by: =?ISO-8859-15?Q?Jean=2DFran=E7ois?= Lemaire | last post by:
Hello all, I'm learning C and I still am struggling to understand some basic concepts. For example, I read in the standard that with functions such as strcpy, 'If copying takes place between...
1
2566
by: Daimz | last post by:
I am making a blog and as part of my template I am wanting to have my header and then another image on the side of that using the z-index: 2; to make it that layer about. so here is the css. ...
2
14057
by: thephatp | last post by:
I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm...
0
2830
by: richard12345 | last post by:
Hi Guys I have problem with site I am building. The sidebar with menu and other thinks is overlapping footer. The footer move with the content and but it dos it dos not move with the sidebar. ...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.