loading...

When `position: fixed;` is not working.

twitter logo github logo ・1 min read

Hello, This is my first posting :)

If a parent elements has transform properties, position: fixed; of children elements does not be working.

That case, The children elements behave like position: absolute;.

Solution to the problem

If a parent elements uses transform animation, Replace without transform animation. or Remove transform properties or Set transform: none;.

twitter logo DISCUSS (2)
markdown guide
 

Also, if the parent element is using the perspective attribute, the fixed postion will not work in the child.

 
Classic DEV Post from Jul 30 '19

When Stack Overflow Goes Offline...

Takaaki profile image
I"m a front-end engineer.

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️