In my main wrapper, which has a fixed width of 960px, there is a login button located at the top right corner. When this button is pressed, a div layer opens directly below and in front of the main wrapper using z-index: 1. The issue I am facing is that I am unable to set a fixed position for the div layer based on the main wrapper's width, instead of the browser window's width. Currently, when I set the left/right position, the div is placed based on the entire browser window width. The main wrapper is positioned at 0 auto for larger resolutions.
For example:
code:
#main {
width:300px;
height: 500px;
background-color: #f23;
margin: 0 auto;
}
#zindex{
font-size: 11px;
width: 50px;
height: 50px;
background-color: #dedede;
position: absolute;
right: 0;--> will place the div depending from the browser window and not main
}
If anyone could provide me with a solution to this issue, I would greatly appreciate it.