Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Tailwind Hero Section with Drop Down Menu

@VaalGeek

Desktop design screenshot for the Intro section with dropdown navigation coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I'm proud that for the 1st time, I was able to create a drop down menu without calling it from a build it class of any material ui library. I should stop assuming that I fully understand concepts.

What challenges did you encounter, and how did you overcome them?

Z index, I thought I understand how it works, but it was until I had to put it into practice with other components and with other classes that I realized that I don't fully understand.

Community feedback

P
Koda👹 3,810

@kodan96

Posted

hi there! 👋

z-index is a tricky property, because sometimes the rendering of the elements depend on the parent container's z-index or position properties. sometimes z-index will not make any difference if you apply it an element with static positioning. if you struggle with z-index, try to apply position: relative; or any other than static (which is the default) positioning to elements. I had a rally hard time figuring this out when I first created a semi-transparent overlay. elements with higher z-index just wouldn't appear above the overlay. then I just applied relative positioning to them and boom.

the other thing is the isolation property, which also can mix things up, because if you apply isolation: isolate; to the parent element that will create an entirely new stacking context.

So just check the position attributes of the elements if you get stuck with z-index, and make sure you don't apply isolation to parent elements unnecessarily.

Hope this helped 🙏

Good luck and happy coding! 🙌

Marked as helpful

1

@VaalGeek

Posted

@koda, but here is another question that has been bothering me, when it comes to the use of Z Index, inside the parent component, the Z index does not work when applied to child components within the parent component (page), you will have to apply it on child components respectively, why is that if you have any clue?

0

P
Koda👹 3,810

@kodan96

Posted

@VaalGeek

sooo, you wanna create a stacking context within a parent element, meaning one of the child elements should appear above the other one after positioning it?

in that case modifying one of the childs z-index should work just fine, but to make sure you can give a higher z-index to the element you want on top and a lower, but positive value to the child appearing below it. you can also try to give the element on top a background-color, this messed me up a couple of times.

0

@VaalGeek

Posted

@kodan96 LOL, Alright I shall give it a try and play around with it. Thanks again for your input.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord