Intro section with dropdown navigation | SASS | Flexbox
Design comparison
Solution retrospective
I would like to know if there are other ways to write and structure HTML and JavaScript code so that both documents are in a nice relation to each other and so I don't have to write this much code. I literally repeated the same things multiple times throughout the project and sometimes I find it overwhelming. General feedbacks are also welcome.
Community feedback
- @AeteungPosted over 2 years ago
I viewed many solutions for this challenge. For me, your layout is on point. There are just a few things to adjust:
- First of all, I think u can create a function with an element argument in which u can adjust its style or classList, and this can reduce the redundant code.
- Moreover, there is a function called element.classList.toggle() that can toggle class instead of using add() and remove(). And u can reduce 1 open/close stage.
- I think u can add an "object-fit: contain" to your img tag as the landscape mobile/tablet size monitor may view your img with a weird scale.
- I don't know why u use div tag for the dropdown menu but I think using ul and li is a better practice for u to create something like this.
- For the mobile nav, I think the font-size is a bit too big as the content will overflow when I open those two dropdowns.
Overall this is a great solution, everything fits the design decently, especially I like how u add a max-width for your content. Well Done. OuOb
Marked as helpful0
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