Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 10 months ago

Responsive card design

EBUNOLUWA•70
@ReactLlord
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • DocForLoop•630
    @DocForLoop
    Posted 10 months ago

    Hi,

    Welcome, I see some issues in your code here are my suggestions:

    • I would use semantic HTML , like main, section, footer
    • I would put every css rules to the separate css file
    • In figma design file there are the correct colors, fonts ,spacings that you can use
    • I would dowload the font files and in css I would use @font-face rules
    • Your h3 element set to display:flex, but it is unnecessary ,because it is not a flex container.

    I hope it will be helpful. All the best!

    Marked as helpful
  • Wisdom•230
    @Unifies
    Posted 10 months ago

    Hi Ebunoluwa, nice work!

    It seems though that you designed this without looking through the style guide. We are supposed to match the colors as much as possible but your chosen colors, background colors and fonts are different from what was given - please check the style guide for every challenge you work on in order to recreate the design as exact as possible.

    Given fonts and colors for this challenge were this:

    • The font family is the Outfit font - Family: Outfit. Grab the embed code for the font from this link and include in your HTML file.
    • White: hsl(0, 0%, 100%) [card container]
    • Slate 300: hsl(212, 45%, 89%) [body background color]
    • Slate 500: hsl(216, 15%, 48%) [color for light text]
    • Slate 900: hsl(218, 44%, 22%) [font color for bold text]
    • Weights: 400, 700

    -- Give a box shadow to the container div and some margin-bottom before the attributions for a cleaner result.

    In order to create a clean, reusable code though, it is recommended to create colors, fonts, and sizes as variables like so:

    :root {
        /* Colors */
        --White: hsl(0, 0%, 100%);
        --Slate-300: hsl(212, 45%, 89%);
        --Slate-500: hsl(216, 15%, 48%);
        --Slate-900: hsl(218, 44%, 22%);
        /* Fonts */
        --fs-h2: 0.95rem;
        --fs-p: 0.85rem;
        --fw-400: 400;
        --fw-700: 700;
    }
    

    and then you can use them for styling like background-color: var(--Slate-300);.

    Reason being: These things may change in a real project, so when it does all you have to do is change them from the root instead of searching in the whole css file/s. --Slate-300 is a custom name, you can name it anything you want. But for readability giving it a meaningful name would be better.

    Other little code changes you might consider making:

    Delete the imported comments in the code that only tell you what to do and move the attribution styling to the external CSS file and delete that block of code from your HTML file

    These don't affect your code in any way but will be a good edit for a cleaner code.

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