div boxes on top of other div boxes

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

div boxes on top of other div boxes

Post by nigma »

Is that possible using relative possitioning?
User avatar
Friday
Forum Newbie
Posts: 5
Joined: Wed May 21, 2003 4:16 am
Location: China

Post by Friday »

define z-index
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

but how do I even get the box ontop of the other box in the first place while using relative positioning?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

use nested <div>-tags

Code: Select all

<div style="blabla" id="myDiv1">
<div style="blabla" id="myDiv2">
</div>
</div>
If you want to use layers on top of each other use z-index, as suggested above, and play with the visibility, if you need to.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

If you look at my site (http://www.mc0.cjb.net) on the far right there is a bar with some options. Under that box are three absolutely positioned div boxes that are invisible. When one of the options on the far right bar is clicked it hides all the other divs that are under the far right bar except for the one that was clicked(such as login). It makes the one that was clicked visible.
Post Reply