Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

qr-code-component

Rai_Sama 380

@raisama21

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


This challenge was simple pretty good for beginner.

Community feedback

P
Fluffy Kas 7,735

@FluffyKas

Posted

Heyo,

This looks really good. Just a few small things to note:

  1. It's better to embed the QR code image in your html. Screen readers won't take not if it's set with css as a background.

  2. The fixed height should be swapped to min-height. On some screens more than a 100vh of the screen would be needed for this component to display so it's better not to lock it.

  3. I believe it's a good idea to use <article> for this challenge, but then the div container for the card isn't needed. The component is the article itself.

Marked as helpful

1

@notabhishekrai

Posted

@FluffyKas Wow. I didn't know you could embed the QR code. Where do I find it??

Btw, isn't it better to use <main> instead of article?? Since its the main component of the page and there isn't anything other than the card?? What do you think??

Marked as helpful

1
Rai_Sama 380

@raisama21

Posted

@notabhishekrai I have only done the basic of html and css and i don't know what I am doing. I am trying to wrap my head around things its only been a month since i started. So, thanks for the feedback :)

1
P
Fluffy Kas 7,735

@FluffyKas

Posted

@notabhishekrai

Just add the image with an <img> tag. ^^

<main> and <article> aren't interchangeable. <main> is used for defining a landmark region in your website. You wrap all your "main content" inside it, be it one component or multiple components, sections. But in itself <main> isn't a component, just a wrapper.

If you get a bit lazy, you could style it as a component I suppose (I definitely did that in the past, lol) but probably it's best not to and just have a separate element for the actual card component, like @raisama21 did here.

It's not even important to include a <main> in a component challenge (since there are no other regions), I usually only do because issues in the accessibility report hurt my eyes >.<

1
Rai_Sama 380

@raisama21

Posted

@FluffyKas I just used the viewport height to center the design vertically, i have not really looked in to responsive design so i think it will be a good start from now on, thanks for the feedback :) It was helpful

0
Rai_Sama 380

@raisama21

Posted

@FluffyKas how do you fit the image with the background size? if you embed it with the <img> tag

0
P
Fluffy Kas 7,735

@FluffyKas

Posted

@raisama21

Add this code to the image itself:

display: block;
max-width: 100%;
height: auto;

This code snippet will make sure your image resize responsively and fit the parent container ^^ Can be reused for any other image in the future (just saying this cos it took me a fair bit of time to figure it out XD)

Marked as helpful

0
Rai_Sama 380

@raisama21

Posted

@FluffyKas Thank you so much for the code, i was bit lazy to search it up for my self xD.

0

@notabhishekrai

Posted

@raisama21 quick question, are you from Nepal??

0
Rai_Sama 380

@raisama21

Posted

@notabhishekrai ahh yar bro Kathmandu bata ho ma

0

@notabhishekrai

Posted

@raisama21 lol me too dubai Rai raixa.

0
Rai_Sama 380

@raisama21

Posted

@notabhishekrai Add/DM me on Facebook https://www.facebook.com/dawa.rai.3110/

0

@notabhishekrai

Posted

@raisama21 check your DM bruh

0

Please log in to post a comment

Log in with GitHub
Discord logo

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