Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Responsive Qr component Using FlexBox

Layiwola Tobi•110
@Laytix
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I had slightly better understanding of responsive design. I will plan to make the designs, particularly the positioning and height work better in different sizes.

What challenges did you encounter, and how did you overcome them?

I tried coding with fixed width and height but received feed back that unless specific it is not good practice to do it often.

What specific areas of your project would you like help with?

Better understanding of how to use em, rem, vw, vh. How to have the divs be the sizes I want without having them be a fixed size.

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • SaruMakes•160
    @SaruMakes
    Posted about 1 year ago

    Hi there! Congratulations on finishing the challenge! 🎉👏

    I'm not the most experienced developer out there by far, but these are things I've learned so far, which might help you out as well:

    Using em/rem 🔤

    The em unit inherits its size from the font size of the parent element, which makes it trickier to work with. I'm sure there are cases where it could be useful, but I find it far easier to stick with rem throughout my projects. If I need to declare a specific font-size on an element/container, I can simply convert the desired font-size into rem. That way, if a user sets their browser to use a larger standard font size, I'm sure that all of the elements/attributes that are sized with rem units will scale proportionally to each other.

    I try to only use pixel values for very specific use-cases, where it won't interfere with the rest of the design, if everything else is scaled up. The basic font-size for browsers is 16px, so you can divide your values by 16 to get your sizes in rem units instead. Be careful with declaring your individual font-sizes in px for the same reason, as that will prevent users from scaling the font-size to fit their needs.

    Controlling Width & Height 📏

    You are sorta already controlling the sizes of your elements of the containers. In this instance, if you feel like the main element is too wide, you can simply set max-width:<value>;, which will prevent the element/container from growing larger than that. As long as you haven't set any fixed widths on nested elements within the container/element, then they should simply scale with the container.

    That way the container won't grow larger than that size, but it will still shrink with the viewport, if it gets smaller than that size.

    Inversely, you can set max-widths on elements nested inside the container, to constrain how large they can be, which in turn will determine the size of the container itself, as it'll grow or shrink to fit its contents.

    I hope this helps! Happy coding! 👍👍

    Marked as helpful
  • JesyQueck•100
    @JesyQueck
    Posted about 1 year ago

    Basically to my own understanding em, rem, viewport width, viewport height ( its sets the height of the div to the % you imputed), Viewport height can be used to style a div tag. But i will advice using the width and height properties in pixels

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