xxxxxxxxxx
// You must be using transform or transform 3d in the parent element
// fixed will not work. example:
<div style="transform:scale(1.1)">
<div style="position:fixed;top:0;left:0">
Example
</div>
</div>
xxxxxxxxxx
/*
* You must be using transform or transform 3d in the parent element
* fixed will not work.
* example:
*/
<div style="transform:scale(1.1)">
<div style="position:fixed;top:0;left:0">
Example
</div>
</div>
xxxxxxxxxx
<style>
.sticky-element {
position: fixed;
top: 20px;
right: 20px;
}
</style>
<div class="sticky-element">
Content that should have a fixed position
</div>