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

Landing page using grid and flexbox

bem, accessibility
Jason Greenwald•200
@jaycgreenwald
A solution to the Ping single column coming soon page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


  • Did I use the aria attributes correctly? I need to learn a lot more about this.
  • I'm still fuzzy on the times to employ min-width, max-width, or width? It works, but could it better? More flexible?
  • JavaScript - is there a difference between accessing an element directly and creating a variable then referencing the variable?
  • What about getElementById versus querySelector? Anything else you can suggest is much appreciated.

Cheers!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Vanza Setia•27,715
    @vanzasetia
    Posted almost 3 years ago

    Hi, Jason Greenwald! 👋

    It's great to see you completing another challenge! So, congratulations! 🎉

    Regarding your questions:

    • In general, you want to do some testing after to see whether everything is correct or not. Have you tried using screenreader on the site? In this case, it's good that you have added aria-label to the input and the social media links. But for the social media links, all of them say the same thing ("Share the news on Facebook"). Also, I would recommend removing the label because it has the input already have the aria-label.
    • For the width, I rarely use it. Also, I rarely use min-width either. For max-width, in this case, I would set a max-width on the container (an element that wraps the page content) to make sure that they won't fill the entire page. I think for the logo, it's okay to set a width since it won't cause any issue.
    • Variable in programming is used to store data. This way, you won't have to type the same code over and over again. You can just reference it by declare the name of the variable. In this case, I notice that document.getElementById("btn-rounded") is repeated twice. So, you might want to create a variable. This way, if you change the id of the button for some reason, then you just need to change the code on the variable itself. Then, everything will get updated.
    • I would suggest using querySelector. Also, I recommend using all classes begin with js- to select DOM elements within the JavaScript. Keep in mind, that only use the js- classes only for JavaScript purposes. This is important to separate the classes for CSS and JavaScript. This will make sure that if you change the styling, you don't accidentally destroy or disturb the functionality. This practice is known as separation of concerns.
    // Example
    const form = document.querySelector(".js-form");
    

    Some suggestions.

    • Always specify the type of the button. In this case, set the type of them as type="submit". It's going to prevent the button from behaving unexpectedly.
    • Why does when I submit a wrong email, the input filled with example@email/com? I would only expect the warning message to appear.

    I hope this helps! Happy coding! 😁

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