I am creating an application on Windows 8 that allows horizontal scroll. What I want to do is make a div be fixed relative to the actual width and height of the app, NOT my screen. Right now the div scrolls when I scroll, but I want it to stay put. I thought position:absolute; tells a div to be positioned relative to its parent, but it is not doing this. I checked to make sure the parent div was fixed and it is using float:left;. Any idea what is going on? Here is some code.
#parentDiv {
height: 720px;
width: 1366px;
float: left;
}
#div {
height: 60%;
width: 15%;
top: 200px;
right: 2.5%;
position: absolute;
border-radius: 25px;
opacity:0;
}
Give your div position fixed … Absolute is not going to help.