0
The natural order of stacking of the elements is that those previously inserted in the DOM tree are below those inserted later. Is the stacking order.
With that, the first div
fixed that you placed will be below the later ones when scrolling. To change this there is the property z-index
which alters the order of stacking elements, and may cause one element inserted before to be on top of another inserted later.
Since the DOM tree can have multiple levels of nodes, each level receives one z-index
according to your position, 1, 2, 3 and so on, you can declare a z-index
to his div
so that it will be on top of the others, assigning a sufficiently high value, and this value may depend on the structure of your project.
But to make it simple, a value of 9 might be enough. Add one to your CSS z-index: 9
to his div
:
#minhaDiv{
z-index: 9;
}
Add a z-index to it.
– Diego Vieira
It worked. Thank you very much!
– João Lucas