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

HTML CSS

@vetaprog85samir

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Hassia Issah 50,690

@Hassiai

Posted

Replace<div class="base">with the main tag, <h3> with <h1> and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html

To center .base on the page using flexbox or grid instead of margin, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.

USING FLEXBOX:
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
USING GRID:
body{
min-height: 100vh;
display: grid;
place-items: center;
}

Give h1 and p the same font-size of 15px which is 0.9375rem, text-align: center, the same margin-left, margin-right and margin-top values. Give p a margin bottom value.

Give the img a max-width of 100% for a responsive content and a border-radius value, the rest are not needed.

For a responsive content, give .base a fixed max-width and reduce its value and there is no need to give .base a height value. max-width: 320px

Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

0

@Mohamedmostafa808

Posted

welcome. Congratulations on successfully completing the first challenge! 🎉

  • I have other recommendations for your code that I think will be of great interest to you.

HTML 🏷️:

  • This solution generates accessibility error reports due to non-semantic coding

  • <html> element must have lang attribute with valid value, so fix it by <html lang="en">
  • So fix it by replacing the <div class="base"> with the <main> semantic element to improve the accessibility and organization of your page.

  • And you can specify width for h1 text with image size in css file. This is to show the design closer to the one in the challenge

I hope I helped you! 😀 First of all, the solution you provided is awesome, And don't let anything get you down

Happy coding!

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