DEV Community

Calvin
Calvin

Posted on

Colourful CSS: Z-Index

🎨

Z-index helps in tricky situations where an element looks like it is layered over another.

Content of the body of the page may show through the navigation bar you create. By placing a z-index:1 in your header section (where your navigation bar is) you can layer the navigation bar on top of the body in such a way that when scrolling through the page, elements you do not get unwanted element positioning.

🎨

Top comments (0)