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 component using HTML and CSS

@Ambe-Mbong-Nwi

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


I wish to ask if there is another method to place a div at the center of the page without using the transform: translate style i used.

Community feedback

@MelvinAguilar

Posted

Hi @Ambe-Mbong-Nwi πŸ‘‹, good job completing this challenge, and welcome to the Frontend Mentor Community! πŸŽ‰

I have some suggestions you might consider to improve your code:

Regarding your question:

  • Centering the element with position would make your element behave strangely on some mobile devices, "there's a chance the content will grow to overflow the parent". You can use flexbox or grid layout to center elements. You can read more about centering in CSS here:

Using flexbox:

body {
   /* max-width: 375px; Remove this*/
   min-height: 100vh;
   display: flex;
   justify-content: center;
   align-items: center;
}

Using grid:

body {
   /* max-width: 375px; Remove this*/
   min-height: 100vh;
   display: grid;
   place-content: center;
}

Here are some other suggestions:

  • Use the <main> tag to wrap all the main content in your solution instead of using <div> to improve the accessibility of the website.
  • The alternative text must not contain hyphens, underscores, or the words "image", "picture" or "photo", because the image tag already provides enough information that it is an image
  • To make alternative texts more worthwhile, add descriptive text to the alt attribute of the QR image to explain what the QR image does. Upon scanning the QR code, you will be redirected to the frontendmentor.io website, so an example of alternative text would be "QR code to frontendmentor.io". You can read more about alternative text here.

Above all, the project is done wellπŸ‘. I hope those tips will help you! πŸ‘

Good job, and happy coding! 😁

Marked as helpful

2

@Ambe-Mbong-Nwi

Posted

@MelvinAguilar Thanks very much your solution was very helpful

1
xpress-devβ€’ 120

@xpress-dev

Posted

You can set: body { display: flex; justify-content: center; align-items: center; }

1

@catherineisonline

Posted

Looks nice πŸ™ŒπŸ» If you want to remove the report issue try to replace your p tag with class first with the h1 tag

0

@Ambe-Mbong-Nwi

Posted

@catherineisonline Thanks for the reply. I tried doing that and resubmitted but the errors still remain

0

@catherineisonline

Posted

@Ambe-Mbong-Nwi You need to click generate new report, in the reports section on this page, it's big red button

0

@Ambe-Mbong-Nwi

Posted

@catherineisonline Thank you I actually did that but still no change. It might be something I'm missing.

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