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

HTML and CSS using flexbox

Kohsey•40
@KohseyPower
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Feedback welcome ! ^^

This is my first submition. I'm trying to learn and practice HTML and CSS. There are probably bad practises, notice me !

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Manuel Gil•340
    @ManuGil22
    Posted over 3 years ago

    Hey Kohsey!

    Im pretty new to html and css too but have some feedback:

    • Im not sure which aproach is correct but i would rather use an <h1> tag instead of a <p> for the title.
    • Not need to have <div> outside the paragraphs. As I told you before im pretty new too but think its just no needed. Divs are mostly used to customize and style some sections, for e.g. if you want to change the background-color of the title. In this case you are not doing anything with them so, there just extra lines.
    • One of the accessibility issues you have is that every <img> tag should have an alternate text. Its used by screenreaders as a description of the image. I would do smth like alt="qr code".
    • Also u have an accessibility issue that its not important but u might want to fix it. It says you should have a main landmark in ur code. That can be easily fixed by adding a <main> tag around the div with id="block". Just like this:
    <main>
            <div id="block">
                ....
            </div>
    </main>
    

    There are all details, nothing big. You made an amazing work there!

    Keep pushing and happy coding!

    Marked as helpful
  • Vee•240
    @JunasVee
    Posted over 3 years ago

    Hi Kohsey!

    I've checked your preview site and its codes in your repository. It looks awesome to me, simple codes only a few lines and the CSS is short as well but everything works fine. Additionally, it's responsive to all screen sizes. I would say that your efficiency is at another level!

    Perhaps the things that you might want to fix are accessibility issues in the report but those issues aren't extremely important. Overall, absolutely well done.

    Marked as helpful
  • Fluffy Kas•7,655
    @FluffyKas
    Posted over 3 years ago

    Hiya,

    Well done on this one, it looks great! There are some best practices you may want to follow (apart from the ones already mentioned by @ManuGil22 which are all good advice):

    1. Don't use ids, use classes instead, especially if you use them for styling. It's the best to get used to designing reusable components and since ids are unique, they cannot be reused elsewhere. So as a general rule, avoid them unless you really need them (sometimes for javascript, for example).

    2. Don't use <strong> to make your text bold. It has a semantic meaning. You could just add font-weight to the text with css.

    3. Not super important here, but usually when you name classes/ids you don't name them after the styles they apply to the html elements (unless you're creating utility classes, but that's another topic). Better to name them after their function and such (for example: "main-title" might be an <h1> heading at the top level, "hero-title" is another heading in the hero section, "cta" for a call-to-action section, etc).

    4. Avoid using height when you can, it's usually not needed. Every element has a default height, which you can increase by adding padding, for example (giving min-height to your body is an exception of course, since it's needed for flexbox to center your component, but for most other things you don't need to do this).

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

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub