I'm trying to have one div stay stickied in the top left, while another bigger main div is centered and absolute. The problem is I can't get stickied div to actually stay sticky while the main div is absolute.
It works if I put the sticky div above the center div and set the center div to normal, however then the center div is pushed downwards, which I'm trying to avoid by setting it to absolute.
Fiddle: http://jsfiddle.net/fqz6gej9/2/
html:
<div id="main">
(stuff here)
</div>
<div id="options">
This should be sticky
</div>
css:
body
{
background-color:gray;
}
div
{
background-color:white;
}
#main
{
position: absolute;
background-color: #FFF;
color: black;
width: 50%;
margin-left: 20%;
}
#options
{
position: sticky;
top: 0;
width: 15%;
}
This is all the information I can think of to give, but let me know if I need to add any more.