Search code examples
htmlcssreactjsz-index

css z-index on elements with "position" property


In my react app I have one component which has position:fixed, bottom: 0 properties. When I scroll down and receive footer I need that component hide behind footer by adding z-index: 0 to fixed component and z-index 9999 to footer but it doesn't work. After giving negative values to fixed component it starts work wrong with other components on the same page.


Solution

  • Add to footer:

    posistion: relative; 
    z-index: 99;