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

Stats preview card component

Gabriela•180
@PaulaR-05
A solution to the Stats preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Here is my solution to the Interactive rating component ✨ I couldn't add the purple opacity...Can someone help me with this, please? :) 😊 Happy to hear any feedback and advice. Thanks!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Account deletedPosted over 2 years ago

    Hey there! 👋 Here are some suggestions to help improve your code:

    • To get the image to look like the FEM example ✅, you are going to want to use the mix-blend-mode along with the multiply value and include a opacity with the value of 0.8 to the image. Lastly, the image’s container must have the background color of hsl(277, 64%, 61%).
    • It is best practice ✅ to use, classes for styling purposes, while using ids solely for JavaScript.
    • The statistics at the bottom are a list ⚠️, so it should be built using an unordered List element.

    More Info: 📚

    MDN <ul>: The Unordered List element

    • Your CSS Reset is being underutilized. 😢 To fully maximize 💯 it, you will want to add more to it. Here are some examples that you can freely use 😁: Josh Comeau Reset Eric Meyer Reset
    • For improved accessibility 📈 for your content, it is best practice ✅ to use em for media-queries. Using this unit gives users the ability to scale elements up and down, relative to a set value.

    If you have any questions or need further clarification, feel free to reach out to me.

    Happy Coding! 🎆🎊🪅

    Marked as helpful
  • TayAki79•160
    @TayAki79
    Posted over 2 years ago

    Hi Gabriela,

    nice job. I still can remember when I first worked on this challenge took me days to accomplished it. Here's a solution I can provide for you:

    background: linear-gradient(hsl(277, 64%, 61%, 0.5), hsl(277, 64%, 61%, 0.5)), url(../images/image-header-desktop.jpg);

    1. You should use 'background' as the attribute not 'content'.
    2. As the first value you use 'linear-gradient' and insert at least two colors in there. Here I use your soft-violet color for both since we don't need any gradient at all.
    3. At the end of the color-code (here we use 'hsla' instead of 'hsl' because 'a' serves as the opacity value) you can type in any value from 0.0 to 1.0. Just try yourself what opacity you guess fits the most.
    4. The second value finally is the url() of your image.

    Note: I applied it on your content attribute inside your @media query. But still I see some difficulties in your code. If you want to work on this together I'd love to. Just hit me up. I expect to learn a bit more myself.

    But anyways. Good job and keep practicing!

    Best regards, AkraDEV

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