Learn More About CSS Pseudo Selectors By Building A Balance Sheet - Step 42

Hello, everything has been great, but I have a question regarding the steps. I have managed to understand everything the course is teaching by reading some documentation or watching videos when something is not explained entirely, but in this specific step there’s a property use that I can’t quite understand and it is the “z-index” property, what is it use for?

#years {
  display: flex;
  justify-content: flex-end;
  position: sticky;
  top: 0;
  background: #0a0a23;
  color: #fff;
  z-index: 999;
  margin: 0px -2px;
  padding: 0.5rem calc(1.25rem + 2px) 0.5rem 0;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Challenge: Learn More About CSS Pseudo Selectors By Building A Balance Sheet - Step 42

Link to the challenge:

1 Like

The z-index property is used to create “layers” for your HTML elements. If you are familiar with image editing tools, you may have worked with layers before. This is a similar concept.

Elements with a higher z-index value will appear to be layered on top of elements with a lower z-index value

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.