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

Sunnyside Landing page using flexbox, grid & vanilla JS

Phil•185
@PhilJG
A solution to the Agency landing page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


2 things I could use help on

  1. the overflow-x: how do I get rid of the white line on the right side?

  2. I used matchMedia to remove the toggle burger/x button when the screen resizes. However when it is shrunk it will disappear. I think it has something to do with the toggling visibility of the drop down nav on the smaller screens but I could not figure it out. Any help would be appreciated :)

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Raymart Pamplona•16,040
    @pikapikamart
    Posted almost 4 years ago

    Hey, great work on this one. Layout in desktop is good and it responds well, the mobile layout is good as well.

    Regarding your queries:

    1. The reason for the extra white line on the right side is your width: 100vw on the nav element. width: 100vw and width: 100% works different, the 100vw takes all the viewport's width along with the dimension of the supposed scrollbar, that is why there is an extra spacing. You could just remove that width property along with the overflow
    2. You don't really need to use javascript on this part, you could have just use media queries in the css, like when it is one media (min-width: 768px), the hamburger menu is active, then when it is beyond that, just show the desktop layout. You should just use javascript to toggle classes or attributes on that hamburger menu, not using to "show" or "hide" it, let css handle it for you ^^

    Some other suggestions would be:

    • Your nav should be inside the header tag. On this one, I would not include the hero-section in the header. Typically, top most header contains the website logo-link and the navigational-links. So on this one, the preferred structure would be:
    <header>
      <div>
        { The website logo image-link is inside here }
      </div>
      <nav>
         { All the list of links are in here }
      </nav>
    </header>
    
    • Always have a main element on the webpage, main element is used to properly navigate your website. A preferred structure again would be:
    <header />
    <main />
    <footer />
    
    • The arrow-icon on the hero-section should have aria-hidden="true" on the svg element so that it won't be read by assistive tech since it is just decoration.
    • When using heading tags, make sure that the lower level heading are present before the current one. For example, if you use h3 make sure that h1, h2 are present before it. You use heading tags incrementally by 1.
    • section elements could be used as well on this so, especially since there is a testimonial-section.
    • The alt for the person for each testimonial should use their names like img alt="Emily R" since the image itself is meaningful since it is the user who have the testimonial.
    • For each images img element that you use, if the element is just decoration, always have alt="" on them, if you don't include that, a screen reader would just read something from the source-code I think, I forgot what it said, but you should always add that, if the image is meaningful, then add a meaningful alt value.

    FOOTER

    • The links should be inside a ul element since those are list of links, also the ul should be inside a nav since those are still your navigational links.
    • The social media links as well should be wrapped inside ul element.
    • The title for each social media svg should only include the name, remove the word logo, when using title or alt do not add words that relates to "graphic" like "image, logo, icon" assistive tech will handle those for you.

    MOBILE

    • The hamburger menu should be a button and not a tag since it is not a link, rather a control-button for the menu-dropdown.
    • The hamburger toggler also should have aria-label="menu dropdown toggler", this will make sure that screen reader users would know what this button does. Also it should have aria-expanded="false" as the default and you should change it via javascript. You might want to search about it, or you could reply in here and maybe I can create a simple snippet.
    • The svg inside the menu-toggler should have aria-hidden="true" since that is just an icon for the dropdown.

    Aside from those, really great job on this one.

    Marked as helpful
  • Phil•185
    @PhilJG
    Posted almost 4 years ago

    That worked great thanks again Raymart!

  • Phil•185
    @PhilJG
    Posted almost 4 years ago

    Hey Raymart,

    Thanks so much for your feedback.

    I made your adjustments and thank you for enlightening me on best practices for proper html arrangement my knowledge is basically zero and this was the first time I was even aware of aria. I made all the adjustments you suggested except the one about adding aria false to my javascript. I didn`t really understand the concept or what you meant I will have to do more research.

    Also, I took your suggestion of removing overflow & and the width from the navbar. It worked, however it messed up my navbar on mobile by squishing it to the left side. Any ideas on how to remedy this issue without causing more overflow?

    And many thanks for your feedback it helped me greatly :)

    Phil

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

Oops! 😬

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

Log in with GitHub