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

HTML & CSS QR Component

Pablo Olvera•20
@pablohimself
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


How can I improve my CSS?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Redon•240
    @redoncapuni17
    Posted almost 2 years ago

    Well done for finishing the challenge

    As a front-end developer, your job is to make the website look just like the designer wants it to. If there are any differences, try to fix them quickly so that the website matches the design as soon as possible.

    This challenge consists of two parts: the mobile component and the desktop component. However, it appears that the mobile part has not been developed. It's important to address this issue and ensure that both the mobile and desktop aspects of the challenge are completed.

    Lack of semantic HTML:

    • Semantic HTML elements are missing or not used appropriately.

    • The structure does not convey the meaning and purpose of different parts of the webpage.

    2. Usage of absolute units instead of relative units:

    • Absolute units like pixels (px) are used for defining lengths and sizes instead of relative units like percentages (%), em, or rem.

    • Relative units are more flexible and responsive across different screen sizes.

    I hope you find this helpful and happy coding

    Marked as helpful
  • Kelf Almeida•230
    @Kelf1729
    Posted almost 2 years ago

    Hi, change it height: 100vh -> min-height: 100vh width: 1440px, take it off, you don't need it.

    Marked as helpful
  • Kacper Kwinta•1,405
    @kacperkwinta
    Posted almost 2 years ago

    To improve your code, you can consider the following suggestions:

    1.Optimize your images:

    • Resize large images to the maximum size they will appear on-screen.
    • Use appropriate image formats, such as highly compressed options like WebP or AVIF.
    • Add width and height attributes to HTML <img> tags or use the CSS aspect-ratio property to reserve space on the page before the image loads.
    • Consider using a specialist image CDN to handle image optimization. Source 3

    2.Avoid CSS @import:

    • Instead of using @import to include CSS files within others, use multiple <link> tags within HTML to load CSS files in parallel. This improves efficiency and loads CSS files faster. Source 3

    3.Preload CSS files:

    • Use the <link> tag with the preload attribute to start downloading CSS files immediately instead of waiting for them to be referenced in the HTML.
    • This is especially beneficial in situations where a plugin could add a stylesheet further down the page. Source 3

    4.Use critical inline CSS:

    • Inline critical CSS into a tag in the <head> section of your HTML.
    • Load the remaining CSS asynchronously to avoid render blocking.
    • This technique improves performance by identifying essential styles used by elements above the fold and loading them first. Source 3

    5.Use media query rendering:

    • Split CSS files and load them using media queries based on screen size.
    • This technique allows mobile devices to load core styles first and download or parse additional stylesheets only if needed. Source 3

    6.Use @font-face to import fonts:

    • Download the TrueType Font file (.ttf) for the font you want to use.
    • Upload the font files to your web server and update the CSS file to reflect the file paths.
    • Use the @font-face rule in your CSS to import the fonts and specify the font-family.
    • Preload fonts and load WOFF2 fonts first to improve performance.
    • Limit the character set for custom fonts if you're only using a few characters. Source 4

    By implementing these optimizations, you can improve the performance and efficiency of your 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
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