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 solution using CSS Flexbox

Angelica 10

@amch123

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


Please tell me how I can improve and best practices

Community feedback

@numan-iftikhar

Posted

Hi, you did fantastic work with your design. It's almost pixel perfect. Here are some suggestions:

  • Use main tag to wrap all the content
  • Get your HTML right
  • Don't use unnecessary div tags
  • Always use rem instead of px for setting font-size property
  • Avoid text-align: center in every element

Marked as helpful

0

Angelica 10

@amch123

Posted

Hi @numan-iftikhar, please tell me how I can improve text-align: center?

0
Vanza Setia 27,795

@vanzasetia

Posted

@amch123 You can put the text-align: center on the main element. 🙂

Marked as helpful

0
Angelica 10

@amch123

Posted

@vanzasetia Done!

0
Vanza Setia 27,795

@vanzasetia

Posted

@amch123 Great! 👏

0

@numan-iftikhar

Posted

@amch123 You can add text-align: center to the parent element, in this case, the body or main element (if you use it). All the content inside the parent element will be centered :)

0
Cooger 270

@Cooger17

Posted

Hi @amch123! Great solution on this challenge

There some tips to improve your code:

1- Use <main> instead of <div> to wrap the card container. This way you show that this is the main block of content and also replace the div with a semantic tag.

2- Use a CSS reset to avoid all the problems you can have with the default CSS setup, removing all margins, and making the images easier to work, see the article below where you can copy and paste this CSS code cheatsheet: https://piccalil.li/blog/a-modern-css-reset/

3- A better way to work this solution image, the product image is by using <picture> to wrap it on the html instead of using it as <img> or background-image (with the css). Using <picture> you wrap both images (desktop and mobile) and have more control over it, since you can set in the html when the images changes setting the screen size for each image.ote that for SEO / search engine reasons isn’t a better practice import this product image with CSS since this will make it harder to the image.

Marked as helpful

0

Angelica 10

@amch123

Posted

@Cooger17 thanks!!

0
Vanza Setia 27,795

@vanzasetia

Posted

@Cooger17

In this case, the image is consistent across all screen sizes. So, there's no need to use picture element.

picture element is used to provide different versions of the same image. I recommend reading the MDN documentation for the picture element to know more about the use cases of the picture element.

So, I recommend using img element instead.

0

@jake4369

Posted

Hi, your solution is pretty spot on, it looks really good and very close to the design.

I only have a few suggestions but of instead of using <div class="contenedor">, you can use a <main></main> tag, this should remove the warning "All page content should be contained by landmarks". Also, there is no need to wrap every element in <div></div> tags. Other than that it's a pretty nice, clean solution, great job!!

Marked as helpful

0

Angelica 10

@amch123

Posted

@jake4369 Thanks!!!

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