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

Semantic HTML5 markup, CSS3, Flexbox, SASS, VanillaJS

Babajide Peter Oyafemi•200
@Babajide777
A solution to the FAQ accordion card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Good day all,

This is my first time using SASS, so I'll appreciate any comment on the file structure and how to make it better. Regards.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • LEUILLIER•120
    @JulienLEUILLIER
    Posted over 3 years ago

    Your code works, you just need to add height to .accordion-svg. By default backgrounds take the height of their container if I'm not mistaken, and if you use your browser Dev-tools you'll see the container has no height. Hope that helps !

    Marked as helpful
  • Marcus Hugo•365
    @marcus-hugo
    Posted over 3 years ago

    I had the same problem when switching to desktop. What worked for me was placing the desktop illustration and bg-pattern as background-images.

    background-image: url(../images/illustration-woman-online-desktop.svg), url(../images/bg-pattern-desktop.svg);
    background-position:  -76px, -571px -248px;
    background-size: 472px, 966px;
    background-repeat: no-repeat;
    

    Hope this helps!

    Marked as helpful
  • Babajide Peter Oyafemi•200
    @Babajide777
    Posted over 3 years ago

    @JulienLEUILLIER Thanks it is working fine now. Regards.

  • Babajide Peter Oyafemi•200
    @Babajide777
    Posted over 3 years ago

    @MirthOsas it still doesn't work with the quotation marks.

  • Osasere Edukhure•20
    @MirthOsas
    Posted over 3 years ago

    Hey buddy, the quotation mark is missing. The syntax for the background image should be something like this: background-image: url("...........");

  • Babajide Peter Oyafemi•200
    @Babajide777
    Posted over 3 years ago

    @marcus-hugo

    Thanks for your time. I really appreciate it. However, the background is still not showing. I updated my code on Github and the live website. Please check it here: https://github.com/Babajide777/faq-accordion-card

    https://babajide-faq-accordion-card.netlify.app/

    Regards.

  • Babajide Peter Oyafemi•200
    @Babajide777
    Posted over 3 years ago

    @marcus-hugo Thanks for the advice Marcos, but I used this method, and for some reason, the background image doesn't show up. Please what do you think might be wrong? This is the code:

    .accordion-svg {
        background-image: url(../images/illustration-woman-online-desktop.svg),
          url(../images/bg-pattern-desktop.svg);
        background-position: -76px, -571px;
        background-size: 472px, 966px;
        background-repeat: no-repeat;
      }
    

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 1st-party linked stylesheets, and styles within <style> tags.

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.

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

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

Oops! 😬

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

Log in with GitHub