Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Layout Basics Positioning Page Content How Z-index Works

Element stacking: Why isn't the banner on top of main-header?

If elements are laid in stacking order of elements later in HTML being on top, why doesn't the banner cover the main-header before the z-stack property is applied?

Hey Jonathan, banner doesn't include any positioning property the stack order in html is according to sequence of element with positioning ... Header include position:fixed so it have some z-index value & after header <figure> contain position:relative which mean it also have some z-index value which is greater than previous positioning element index that's why figure element overlapping the header.

Hi Kartikey, thanks for responding.

I just noticed that the figure element has a 'position: relative' property. I think you meant: "Header include position:fixed so it have some z-index value & after figure contains position:relative which mean it also have some z-index value which is greater than previous positioning element index that's why figure element overlapping the header."

Thank you for helping me figure this out!

Could you post the code?