Intro section with dropdown navigation using React and SASS
Design comparison
Solution retrospective
This was a tough one, I struggled working on the dropdown for a lot of time, can you show me how did you do it? Thanks!
Community feedback
- @elaineleungPosted over 2 years ago
Hi Ly Dinh, I think you did a good job in putting this together, as it really is not an easy challenge!
About the dropdown navs, you can check out this CodePen of dropdown navs that I wrote as a draft/practice for this challenge (I have a fuller version at this CodePen). You can play around with it on CodePen and see whether that gives you any ideas. I think your dropdown navs work fine in desktop view; in the mobile nav, they can be a bit jumpy.
I noticed that your hero image is a big distorted; I think you need to add a
object-fit: cover
orobject-fit: contain
to make sure the image proportions remain the same when resizing.Good luck, and keep going!
Marked as helpful0@winprnPosted over 2 years ago@elaineleung thank you for those 2 codepen links, they really help a lot. I'll learn more about the
object-fit
property as I didn't know it very well. One more question, is there any ways to make dropdown menus with hover instead of click? Thank you.0@elaineleungPosted over 2 years ago@winprn There are a few ways to do it, either with a
mouseenter
event listener when hoevered over andmouseleave
event listener when no longer hovering, or you can try having the dropdowns ondisplay:none
and add a:hover
on the element that changes thedisplay:none
todisplay:block
when hovered over.1
Please log in to post a comment
Log in with GitHubJoin 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