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

QR_Code_Component with internal CSS ad flex box

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

Solution retrospective


i have doubt why i am unable to have the border radius for the image at a 4 side which are not equal. what do you think about it. any feed back or suggestion is always welcomed. i have used internal CSS for this challenge. community comment and suggestion motivate me lot . thank you.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Melvin Aguilar 🧑🏻‍💻•61,020
    @MelvinAguilar
    Posted over 2 years ago

    Hi there 👋. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.

    Regarding your question:

    • Usually, images have a bottom margin. To remove it, use display: block on the image and it will have the borders the same size

    HTML

    • Use the <main> tag to wrap all the main content of the page instead of the <div> tag. With this semantic element you can improve the accessibility of your page.
    • Use the <footer> tag to wrap the footer of the page instead of the <div class="attribution">. The <footer> element contains information about the author of the page, the copyright, and other legal information.
    • You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.: <h1 class="sr-only">QR Card Component</h1>
    • Since this component involves scanning the QR code, the image is not a decoration, so it must have an alt attribute. The alt attribute should explain its purpose. e.g. QR code to frontendmentor.io

    CSS

    • You should not use inline-CSS because it is not a good practice. Instead, you should use an external stylesheet to style your page. By doing this, you will be able to have a better organization of your code and will be able to understand it better.
    • Instead of using pixels in font-size, use relative units like em or rem. The font-size in absolute units like pixels does not scale with the user's browser settings. This can cause accessibility issues for users who have set their browser to use a larger font size. You can read more about this here.

    Please don't worry if your suggestions are long, they are just details. In the end, the project is well done 👏. Hope you find those tips helpful! 👍

    Happy coding! 🎄**

    Marked as helpful
  • Ric•210
    @Ripra87
    Posted over 2 years ago

    Hi Morden, I checked your code, i'm not so expert but i noticed that the heigth of your image container is bigger than your image, so the bottom border of your image is cutted, your image is 300 x 300 px, and the container is 300 x 304 px, if you change your container to the same size of the image it should work. You can easily see it with pesticide, if you don't have it i really suggest you to download, is a browser extension :)

  • moh amine•90
    @Touilamine31
    Posted over 2 years ago

    if you put border-radius on img it will work. i dont think you need to nest the img inside a div here since its already inside the big container it will be simpler and will avoid problems like this

  • Victor Resines•110
    @VictorResines
    Posted over 2 years ago

    Hi MordenWebDev!

    I just did this challenge on the weekend.

    What I noticed is that the shadow for the card is missing.

    To achieve this you could add a box shadow on your '.card_container' .

    I used the following parameters: box-shadow: 0px 20px 30px 10px rgba(0, 0, 0, 0.05);

    These values refer to: offset-x | offset-y | blur-radius | spread-radius | color

    You can fin out more at: https://developer.mozilla.org/es/docs/Web/CSS/box-shadow

    Hope you find these feedback helpful! Everything else looks good to me, happy coding!

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

Oops! 😬

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

Log in with GitHub