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

Responsive landing page using CSS grid

jquery
Wissem•180
@Wissemh
A solution to the FAQ accordion card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


This is my first project ever. Even though it is a simple one, it helped me practice some basic concepts I've recently learn theoretically. I'll be very happy to recieve any comments on my Frontend Mentor or Gmail accounts that can help me improve my skills.

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

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

    Hi Wissem! 👋

    Congratulations on finishing your first challenge! 🎉

    I get an alert message when I view your website, it says the following:

    "Please note that this project only has a desktop and a mobile version. No special design for meduim screens."

    I would recommend removing the alert message and also even though the design images only provide the desktop and mobile layout, you should still make the website responsive. In this case, you could make the tablet layout as one column (the same as the mobile layout). 🙂

    Some feedback:

    • Accessibility
      • Good job on using footer landmark! 👍
      • All the page content should live inside landmark elements (header, nav, main, and footer). By using them correctly, you can make users of assistive technology navigate the website easily. In this case, you can wrap all of it with main tag,except the attribution.
    <body>
      <main>
        page content goes here...
      </main>
      <footer class="attribution">
          attribution links goes here...
      </footer>
    </body>
    
    • Currently, the accordion panels are not accessible. The easiest way to fix this issue is to use the native HTML accordion, which are details and summary.
    • Use CSS border property to create the line. hr element has a role as a separator. In this case, the content below the line should not be separated.
    • Always wrap text content with a meaningful element. Only use div and span for styling purposes. You can read this article about div, written by Scott O'Hara. It will tell you when to use div and how to use it.
    • Every img tag should have alt attribute. If you think the arrow icons and illustration are decorative, you can leave the alt="" empty and it is still a valid HTML.
    • Use rem or sometimes em unit instead of px. Using px will not allow the users to control the size of the page based on their needs.
    • Styling
      • I would recommend using flexbox to align the arrow icon.
      • Put a max-width on the container element to prevent it becoming too wide on mobile landscape view (640px * 360px).
      • To make the card perfectly in the middle of the page, you can make the body element as a flexbox container instead of using the placeholder element.
    /**
     * 1. Make the card vertically center and
     *    allow the body element to grow if needed
     */
    body {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh; /* 1 */
    }
    
    • Functionality
      • I would recommend creating a function where the user is only allowed to open one accordion panel at a time. By doing that, you can prevent the card from having a lot of height.
    • Best Practice (Recommended)
      • Write your code with consistent style (e.g. the indentation, quotes, whitespace, etc). If you write your code with consistent style, it will make it easier to read for everyone (including you, yourself).
      • There's no need to put a space before and after the equal sign.
    <div class = "question">
    

    That's it! Hopefully, this is helpful! 😁

    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