Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Responsive intro-section made with tailwindcss and javascript

tailwind-css
Aldo Adabunu•310
@KwakuAldo
A solution to the Intro section with dropdown navigation challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


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

I learned a lot about javascript with this project, especially with the drop down menus. There is still a lot I need to polish with this project and I would love some feedback on what to improve on and how to add the shadow overlay without breaking the side nav menu in mobile view.

What specific areas of your project would you like help with?

How to make the menus open one at a time, and have them close if anywhere on the page but the menu element itself is clicked on. I would also love to know how to get the shadow overlay when the side menu opens to work without it breaking the page, if you look at my solution I already attempted it with an empty div but that seems to break the code, any solution on how to go about that is welcome.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Grace•32,130
    @grace-snow
    Posted about 1 year ago

    I'm afraid this overflows my mobile screen a lot and behaves strangely when the mobile menu is open because I can still scroll. I'm away from a computer but I expect there may be problems at other screen sizes too.

    Before that though, I'll go through the html and list out some necessary changes & recommended improvements as those are the most important to start with...

    1. The mobile menu (hamburger) menu button must be the first element inside the nav. This is so that assistive tech users can find it easily.
    2. That same button must have an aria-expanded attribute, whose boolean value will toggle between false and true on click (thus communicating the state of the disclosure to assistive tech, if its expanded or collapsed). This is necessary on all buttons that trigger a disclosure so is needed on all of these "dropdown" triggers within the nav. They are not anchors. I've written up a full post about disclosure UI code and recommend you read it.
    3. Additionally, I recommend the hamburger open/close buttons are just one button. You can change which icon is visible within the button based on its aria-expanded state (true/false).
    4. The hamburger menu button must have an accessible name. Currently you are using the image alt for that, which is OK but it would need to say "navigation toggle" instead of "hamburger menu" and "close menu icon". Alternatively you could leave alt blank on those icon images and use aria-label on the button instead, or visually-hidden label text inside the button. The way you choose to solve it is your choice from those options.
    5. "Register" should be an anchor not a button. Same with "learn more".
    6. The paragraph underneath the h1 is definitely not an article. Make sure you understand what that landmark is for.
    7. The company logos are important content, not decorative in my opinion. You have to ask - are they included for a reason? It's to show clients. That's valuable information for people to know about a brand/service so must not be hidden from assistive tech users.
    8. I also think you are misusing the section element. This doesn't particularly matter as sections only have meaning when they are labelled. But as a general rule think of a section as a significant chunk of content that always has a heading, usually a h2). It should not be used as a generic wrapper for an image just to make a layout work. That's what a div is for.
    9. Try to make sure all content is contained within landmarks. That means the attribution should be in a footer.
    10. If links ever open in a new tab, make sure they include some visually-hidden text (eg in a span) that communicates that behaviour eg "(opens in a new tab)"
    11. Don't have empty divs in the html for no reason. I see one at the end of the nav for example.
    Marked as helpful

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SASS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub