开发者

Keeping HTML div in one place

开发者 https://www.devze.com 2023-02-16 19:48 出处:网络
I want to keep several divs at one place and want to show them on clicking on the respective buttons but they are coming in a row format. Actually I want开发者_如何学Go to keep then overlapping each a

I want to keep several divs at one place and want to show them on clicking on the respective buttons but they are coming in a row format. Actually I want开发者_如何学Go to keep then overlapping each another.


You have to use absolute positioning and z-index to put one on top of the other.

Check this example, and modify z-index to see how it changes: http://jsfiddle.net/Pizzicato/LgN9z/


You can do it with absolute CSS positioning. Here is tutorial on this topic with examples. Overlapping of HTML elements is done through z-index CSS property.

0

精彩评论

暂无评论...
验证码 换一张
取 消