View Full Version : CSS/DIV Position 2 layers in the same place

12-04-2005, 03:30 PM
Re: https://secure.glxhost.com/order/new.cgi?package=1

I am trying to create a button which switches a DIV layer to visible or not- so that the customer can either have a "NEW CUSTOMER" or "EXSITING CUSTOMER" box to use.

I've got this to work great by using two <DIV>'s, and using javascript to set them visible or not.

The problem is, the first box on the page will take up a lot of room, pushing the second DIV further down the page.
I would like both divs to start in the same place.
I was planning to use POSITION:ABSOLUTE, however, the position is not absolute, because the content above it could change.
How do i tell two DIV layers to position themselves at the top of a table?

Mr J
12-04-2005, 04:09 PM
You could possibly use position:relative

Take a look at these 2 example divs they are both in the same place

<div style="width:100px;height:25px;border:1px solid red">Hello World</div>
<div style="position:relative;top:-25px;width:120px;height:25px;border:1px solid blue">Hello World</div>