Languages

CSS - issue with position: fixed element inside position: fixed element

6 points
Asked by:
Kevin
797

Is it possible to use position: fixed element inside other position: fixed element in the way position: absolute works?

As I noticed, position: fixed style sets element position according to the document - not according to the parent element that has position: fixed also. It causes covering one element by second one messing my layout.

What I want (screenshot):

What I get (sample code):

 

1 answer
5 points
Answered by:
Root-ssh
178260

There is only one solution: use position: absolute for the inner element.

Example:

 

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join