F
F
Fejja2020-05-11 15:50:30
css
Fejja, 2020-05-11 15:50:30

How to do without absolute and fixed?

You need to use z-index to display the element on top of the block that appears on click. But its position depends on the context of the blocks to be clicked on. They are located across the width of the screen and the block accordingly appears anywhere.

fixed doesn't work, but
absolute works too, because the rest of the elements on the page move out

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eRKa, 2020-05-11
@Fejja

It is worth showing the markup and styles that are there, because. it is necessary to look for a solution from what is.
If you want one block to be displayed on top of another, then this other block should fall out of the flow, which means it is position: absolute, and position: relative - within which block it should appear.
If absolute is for the block that is on top, then nothing should move out.
Workarounds - using js, replacing one block with another.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question