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

Results summary component/ Flexbox

ShyamCanCode•90
@Itachidorri
A solution to the Results summary component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I faced problem when adding color to the ability titles "Reaction, Memory" etc. Is it because of CSS specificity issues? Help is much appreciated. Hare krsna!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    markus•2,700
    @markuslewin
    Posted about 2 years ago

    The url() should be relative to the URL of your CSS. The browser is looking for the font inside /results-summary-component/css/assets/fonts/, but the font is hosted at /results-summary-component/assets/fonts/. Try changing the src of the @font-face to url("../assets/fonts/HankenGrotesk-VariableFont_wght.ttf") format("truetype");.

    The preview for this challenge looks a bit strange because they screenshot the site using a different height from the one in the design.

    Marked as helpful
  • Mihailescu Fanush•740
    @Fanushhh
    Posted about 2 years ago

    Hello there,

    Good job on your solution so far. And to answer your question, yeah, it due to specificity in your CSS. The problem here is that you are specifically setting the headings of the subcontainer flex-2 section to be black which is quite specific in general. I would suggest before setting up a new project to study the design, see which font color dominates the layout and set a general font color on your body tag and then, when you reach a component/section/title whatever that has a different color, set it only for that.

    My advice, remove the sub-container-2 h2, h3 colors, add 4 new classes that have the name corresponding the summary items in your html. For instance, summary-item one is red, so created a class called 'red', and add the appropriate properties to change the font color and background color according to the design.

    Hope that helps and happy coding! Fanush

    Marked as helpful
  • visualdennis•8,375
    @visualdenniss
    Posted about 2 years ago

    Hi,

    Regarding font-family, alternatively you can use this method: Add this to on very top your CSS file:

    • @import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,500;0,700;1,800&display=swap");

    and you can use it like so then:

    • font-family: "Hanken Grotesk", sans-serif;

    Hope you find this feedback helpful!

  • ShyamCanCode•90
    @Itachidorri
    Posted about 2 years ago
    1. Another Question I'd like to ask is the font-style 'HankenGrotesk' isn't working. Can someone tell why?
    2. Also the design looks way ugly when it is shown in the design comparison window of 'frontendmentor', however when you check the design in 'preview site', it looks decent. Can someone explain why?

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