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

Responsive design with flexbox. custom variables.

ed•40
@Barcode77
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?

Im most proud of using my time adequately compared to my first project. With the new knowledge i had learnt, such as flexbox, creating the layout was actually fun

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

in the challenge, i had some problem aligning the the text.however, I browser inspection tool to test the different layouts in real time.

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

flexbox. as much as i have some knowledge, i'd like to cement it. eg. the best and most concise way to have done this project with flex.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • hitmorecode•7,540
    @hitmorecode
    Posted 8 months ago

    Nice well done, your html structure looks good. Just a few pointers.

    • I see you add two <br> tags to create more space between the <h1> and <p> tag. Using br tags to achieve this is not good practice. If you want to create white space between elements, just use margin or padding with this you have a much better control in creating white spaces.
    • When setting the height of the body, make it a habit of using min-height instead of height.
    • By default the width of the body is already 100%, so you don't have to add width: 100vw on the body.
    • Inside .text h1 and .text p you have margin: 0; you don't need this, because you already set all margin to 0 in the CSS reset

    As a suggestion it's best to use rem over pixels for font size. This has to do with the fact that rem scale better than pixels. Just do a research on rem over pixels.

    The problem in converting pixels to rem is the calculation method. There is a simple way to convert pixels to rem without much of a calculation. This is how you can do it.

    // add this to the root
    :root {
       font-size: 62.5%;
    }
    
    // add this to the body
    body {
      font-size: 1.6rem;
    }
    

    With this you have created a base 10 system. Now all you have to do is divide the number of pixels by 10 and you'll have the value of rem*. So font-size: 22px will be font-size: 2.2rem.

    I hope you find this helpful. Keep it up* 👍👌

    Marked as helpful
  • Adriano•42,890
    @AdrianoEscarabote
    Posted 8 months ago

    Hey ed, how’s it going? I was really impressed with your project’s result, though I have some advice that could be helpful:

    You have used <br> , using <br> is not only bad practice, it is problematic for people who navigate with the aid of screen reading technology. Screen readers may announce the presence of the element. This can be a confusing and frustrating experience for the person using the screen reader.

    You can read more in MDN.

    Everything else looks great.

    Hope this helps! 👍

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