Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

Intro section with dropdown, React

react
Joel•590
@JoelLH
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


First time doing dropdown menus The hardest part was being able to display the nav correctly. My cody is not super clean tho. Any feedback is welcome, thank u!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Elaine•11,360
    @elaineleung
    Posted almost 3 years ago

    Hi Joel, this looks good! The mobile nav works, and the dropdowns also. I think you did well also in keeping the image and text containers at a good size and at optimal views.

    Some other comments:

    1. I notice that at mobile view before the breakpoint changes, the image becomes stretched out. You'll need to add an object-fit: contain, and that should fix it!

    2. For .hero at mobile view, you can try width: min(100%, 80rem) instead so that the text doesn't stretch out as much, and then at desktop view, you can either just use width: 100% or width: min(100%, 80rem) so that things don't stretch out too far here. If you use min(), be sure also to add margin-inline: auto.

    3. For the React side, I think you can try making a component for the links since they appear quite repetitive, and they can practically can be made into a component.

    That's about it, great work since it is not easy to make this look good!

    Marked as helpful
  • Md5 dalton•1,430
    @md5dalton
    Posted almost 3 years ago

    Hello Joel. Congrats on finishing the challenge.

    A few of suggestions in your styling would be to :

    • Remove the height on .hero-img selector so that image can be displayed in correctly through different viewports.

    • Add z-index greater than 0 on your .dropdown selector to elevate it obove main content:

    .dropdown {
         z-index: 1;
    }
    
    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

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, 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.

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