The problem here is related to the .content-container
wrapper class, which includes a CSS rule of
webkit-transform: translate3d(0,0,0)
. This transform rule, as explained in this post, changes the positioning context from the viewport to the rotated element, causing the
fixed
element to behave as if it were absolutely positioned. Below is an example that demonstrates the difference between having a fixed element inside a transformed
div
versus having it outside.
.rotate {
transform: rotate(30deg);
background: blue;
width: 300px;
height: 300px;
margin: 0 auto;
}
.fixed {
position: fixed;
background: red;
padding: 10px;
color: white;
top: 50px;
}
<div class="rotate">
<div class="fixed"> I am fixed inside a rotated div.</div>
</div>
<div class="fixed"> I am fixed outside a rotated div.</div>
To resolve this issue, you will need to eliminate the transform3d
declaration from the .content-container
class.