473,725 Members | 2,295 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 12895
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********@ade lphia.net> wrote in message
news:11******** ************@f1 4g2000cwb.googl egroups.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
4675
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 events into a list of non overlapping time spans "meta-spans". This nice ascii graph should show what I mean. 1) --- 2) ---
3
12817
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 for an answer on HOW to do this--I don't necessarily need it to be written for me (although it would not go unappreciated!).
2
12036
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 back to 0,0 on the entire page. If I set it to relative, the div layers will not overlap as needed. I prefer to avoid javascripting an 'innerHTML' re-write of a single div and would instead like to build two layers that can reside at the same...
3
4544
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 transparent, the background image should be visible. Can any one help me in this?
4
3238
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 anything in GDI to check for overlapping controls?
4
4870
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 objects that overlap, the behavior is undefined.' But how can I be sure that they don't overlap? For example, if I write this: char string1 = "overlap";
1
2578
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. .splash { z-index: 2; width: 135px; height: 386px; margin: 0 auto; position: relative; left: 450px;
2
14073
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 really confused as to what is going on in IE. FF renders the page exactly as I expect. IE renders the page with everything in the correct location, but it seems to double the background image for a sub-div section that is moved up using a negative...
0
2846
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. Here is the website: holtz-realty And also the html file and css file. Anny help will by mostly appreciated. I did try everything I can think of. HTML:
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.