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 and i used Flexbox to center the card

@thomasmestdagh

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 is the first time i try to copy something as accurate as possible. Any feedback would be most welcome!

Community feedback

@0xabdulkhaliq

Posted

Hello there 👋. Congratulations on successfully completing the challenge! 🎉

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

COMPONENT MEASUREMENTS 📐:

  • The width: 100vw property for section element is not necessary. because it's a block level element which will take the full width of the page by default.
  • Use min-height: 100vh for section instead of height: 100vh. Setting the height: 100vh may result in the component being cut off on smaller screens.
  • For example; if we set height: 100vh then the section will have 100vh height no matter what. Even if the content spans more than 100vh of viewport.
  • But if we set min-height: 100vh then the section will start at 100vh, if the content pushes the section beyond 100vh it will continue growing. However if you have content that takes less than 100vh it will still take 100vh in space.

.

I hope you find this helpful 😄 Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

2

@thomasmestdagh

Posted

@0xAbdulKhalid Hey, thanks for the detailed feedback, it really helps!

0
P
Jenna 230

@NandiniCooppen

Posted

Hello thomasmestdagh,

Congrats on completing the QR- code challenge 👏

Here are some improvements that I would like to suggest :

improve accessibility

1. Alternative text

Adding a more meaningful description to the 'alt'.

For example alt="QR code for Frontend Mentor website"

2. Semantic structure

I have noticed that you have used the semantic HTML5 tag "section" in your structure. However to improve the document structure and in return improve its accessibility, consider using <header>, <main>, <article>, and <footer> elements where applicable.

3. Headings Instead of the <p> tag for the title, consider using the <h1> tag to provide a descriptive title.

For example :

<main>
<section class="card-section">
<div class="card">
<img class="card-img" src="images/image-qr-code.png" alt="QR code for Frontend Mentor website">
<div class="card-content">
<h1 class="card-title">Improve your front-end skills by building projects</h1>
<p class="card-text">Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p>
</div>   
</div>
</section> 
</main>

Read more about accessibility here

Read more about semantics here

Read more about headings here

Using CSS variables

For example, using the style guide provided, you may create your CSS colors variables as follow :

root {
--white: hsl(0, 0%, 100%);
--light-gray: hsl(212, 45%, 89%);
}

Read more about CSS custom properties here

Using min-height

From .card-section remove width: 100vw and height: 100vh.

Add min-height:100vh;

.card-section {min-height:100vh;}

Read more about min-height here

Fix box shadow

I notice that your rgba value is not okay for your box-shadow. You have a value in excess.

box-shadow: 0 0 30px 0 rgba(0,0,0,0.0.2);

It should be like this :

.card { box-shadow: 0 0 30px 0 rgba(0,0,0,0.2); }

Read more about box-shadow here

Remove space on line 19 in your style.css file

I noticed there's a space between background-color: hsl(212, 45%, 89%); and display flex; for .card-section

I hope these will be helpful to you 😉

Good luck going forward and happy coding 🙂

Marked as helpful

0

@thomasmestdagh

Posted

@NandiniCooppen Hey, thanks for the detailed feedback, it really helps!

1

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