Change the Position of Overlapping Elements with the z-index Property
When elements are positioned to overlap (i.e. usingposition: absolute | relative | fixed | sticky), the element coming later in the HTML markup will, by default, appear on the top of the other elements. However, thez-indexproperty can specify the order of how elements are stacked on top of one another. It must be an integer (i.e. a whole number and not a decimal), and higher values for thez-indexproperty of an element move it higher in the stack than those with lower values.
Add az-indexproperty to the element with the class name offirst(the red rectangle) and set it to a value of 2 so it covers the other element (blue rectangle).