QR Code Component challenge using HTML5 semantics and CSS flexbox
Design comparison
Solution retrospective
What I'm Most Proud of
I am most proud of how I was able to integrate Google Fonts into my project, giving it a polished and professional look with the "Outfit" font. This small detail really made a difference in the overall design and enhanced the user experience. I'm also proud of how I applied Flexbox to structure the layout. It was my first time using Flexbox, and it was rewarding to see how easy and flexible it was for centering and aligning content.
Additionally, I'm proud of the fact that I focused on responsive design from the start, ensuring that the layout looks good across different devices. This was an important step toward making the site accessible and user-friendly.
What I Would Do Differently Next Time
Next time, I would experiment more with CSS Grid alongside Flexbox for even more control over complex layouts. While Flexbox works great for simpler structures, I think CSS Grid would be beneficial for creating more intricate designs. I would also focus on improving accessibility by adding appropriate ARIA labels and ensuring better screen reader compatibility.
I also plan to refine my workflow with Git for version control and start using it earlier in the project to track changes more efficiently. Lastly, I would like to focus on making the design more interactive with some JavaScript to enhance the user experience even further.
What challenges did you encounter, and how did you overcome them?Challenges I Encountered and How I Overcame Them
One of the main challenges I faced during this project was using Git commands in PowerShell. I encountered issues with understanding and executing commands properly, especially when it came to staging, committing, and pushing my changes to GitHub. At first, I was unsure of the correct syntax and encountered errors that slowed me down.
To overcome this challenge, I turned to multiple learning resources including online tutorials, articles, and YouTube videos. Specifically, I found tutorials from Atlassian Git tutorials and Net Ninja's YouTube tutorial on GitHub Pages to be incredibly helpful. These resources explained Git concepts clearly, which helped me understand the commands and how to troubleshoot issues effectively.
By actively looking up solutions and practicing the commands, I was able to build confidence and resolve the issues, which ultimately helped me improve my Git workflow.
What specific areas of your project would you like help with?Areas I Would Like Help With
I would like to dive deeper into HTML semantics to improve the structure and accessibility of my web pages. Understanding how to use semantic HTML elements properly will help me create cleaner, more accessible, and SEO-friendly websites.
Additionally, I want to expand my knowledge on website responsiveness. While I've started using responsive design techniques, I would like to explore more advanced concepts and tools, such as media queries and fluid layouts, to ensure that my websites look great on all devices and screen sizes.
Finally, I aim to improve my CSS styling and design skills. I want to learn more about advanced CSS techniques, like CSS Grid and CSS animations, to enhance the aesthetics and interactivity of my projects.
Community feedback
- @Islandstone89Posted 4 days ago
Hi, well done!
Looking through your code, these are my suggestions for improvement.
I hope they are clear and helpful - good luck :)
HTML:
-
Remove
<section>
, it is not needed. -
Remove
<header>
- this is used for content that stays the same on several pages, like a logo and navigation bar you often see at the top of every webpage. -
I would change the heading to a
<h2>
- a page should only have one<h1>
, reserved for the main heading. As this is a card heading, it would likely not be the main heading on a page with several components. -
Do not use
<br>
to force text onto a new line. The text should flow naturally, and all styling, including space between elements, should be done in the CSS. -
Wrap the footer text in a
<p>
. -
The
<footer>
must be outside of the<main>
, since they are both semantic landmarks. -
It's best practice to give elements a class, and use that as a CSS selector.
-
Ideally, your HTML should look something like this:
<main> <div class="card"> <img src="images/image-qr-code.png" alt="QR code leading to Frontend Mentor" class="qr-image"> <h2 class="heading">Improve your front-end skills by building projects</h2> <p class="text">Scan the QR code to visit Frontend Mentor and take your coding skills to the next level.</p> </div> </main> <footer class="attribution"> <p>Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. Coded by <a href="https://github.com/ghazibenattia">Ghazi Benattia</a></p>. </footer>
CSS:
-
Including a CSS Reset at the top is good practice.
-
I recommend adding a bit of
padding
, for example16px
, on thebody
, to ensure the card doesn't touch the edges on small screens. -
On the
body
, changeheight
tomin-height: 100svh
- this way, the content will not get cut off if it grows beneath the viewport. Addflex-direction: column
, so thefooter
is underneath themain
and not to its side. -
Remove all widths in
%
. -
font-size
must never be in px. This is a big accessibility issue, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead. -
Since all of the text should be centered, you only need to set
text-align: center
on the body, and remove it elsewhere. The children will inherit the value. -
On the image, remove
max-height
. Adddisplay: block
,height: auto
and changemax-width
to100%
- the max-width prevents it from overflowing its container. Without this, an image would overflow if its intrinsic size is wider than the container.max-width: 100%
makes the image shrink to fit inside its container.
Marked as helpful0@ghazibenattiaPosted 4 days ago@Islandstone89 Thanks a lot for the feedback, I will work on improving the site this weekend.
1@mkalkandevPosted 3 days ago@Islandstone89 Hello. The challenge is not mine, but your comment gives me an idea, thank you for that. I request you to enlighten me about my challenge, any shortcomings or mistakes I may have.
https://www.frontendmentor.io/solutions/creating-a-blog-card-using-flexbox-P2jMxfFuBJ
and
https://www.frontendmentor.io/solutions/css-flex-kullanarak-qr-menu-rmlbMA0zpO
and
https://www.frontendmentor.io/solutions/simple-social-media-links-using-flexbox-and-semantic-tags-9aGVHMi-U0
1@mkalkandevPosted 3 days ago@Islandstone89 I'm curious about your thoughts. Thank you.
1 -
Please log in to post a comment
Log in with GitHubJoin 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