The css property z-index only works on positioned elements, meaning elements must be position absolute, fixed or relative in order for the z-index property to take effect. The higher the z-index the closer to the front it will appear. The values specified for the z-index property can be positive or negative.