Design comparison
Solution retrospective
Hi, Please comment the flaws you find, I am trying to improve my skills. I have not used flex in this one because I started understanding it from today itself but in upcoming challenges I will use flex for positioning.
Community feedback
- @DavidMorgadePosted about 2 years ago
Hello Sarthak, great job getting the challenge done! congratulations!
In addition of what other mentors said, I would recommend you to not use
position: absolute
when you are building your layout, you should go for flex-box or CSS grid, those are powerfull tools that will help you A LOT when building your webpage, you can do any type of layout using those tools!If you are interested in learning grid or flex-box, you can learn them just playing games! I recommend you a bit of search on google of the basic and after that try flex-box-froggy and grid-garden, the first levels are really easy and you will learn a lot from them!
Hope my feedback helped you, keep going with those solutions!
Marked as helpful1@MsarthaksharmaPosted about 2 years ago@DavidMorgade Hi, I am learning flex and it is such a good news. I was unaware of these games. I will definitely try them.
1 - @correlucasPosted about 2 years ago
👾Hello Shartak, congratulations for your new solution!
Your solution seems already really good, two things you can do to improve it is to replace the h5 with one h1 since this heading is the main title for this page. About the html structure you can reduce it removing some unnecessary div, for this challenge you can keep all content inside a single block/div. For example
div (img h1 and p) div
.The correct value for this shadow is
box-shadow: 5px 4px 15px 5px rgb(0 0 0 / 3%);
Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR
✌️ I hope this helps you and happy coding!
Marked as helpful1@MsarthaksharmaPosted about 2 years ago@correlucas Hi,
Thank You. I will try to implement and improve it. I am unable to access your link maybe because maybe I am at very initial level to this website.
1@correlucasPosted about 2 years ago@Msarthaksharma try this https://www.frontendmentor.io/solutions/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR
Marked as helpful1 - @PhoenixDev22Posted about 2 years ago
Hi Sarthak Sharma,
Congratulation on completing this frontend mentor challenge. Your solution looks great. I have some suggestions regarding your solution:
- You should use
<main>
for the card and<footer>
for the attribution . HTML5 landmark elements are used to improve navigation experience on your site for users of assistive technology.
- Page should contain
<h1>
. In this challenge , you may use<h1>
instead of<h5>
.
- In my opinion, the image is an important content. As you have used CSS for the image, it’s not accessible anymore. The only method that is truly accessible and supported by nearly all browsers is to use inline images instead of background CSS images to display non-decorative content. The alternate text is needed on this image. The alternate text should indicate where the Qr code navigate the user : like QR code to frontend mentor not describes the image.
- In order to center the card on the middle of the page , you can use the flex or grid properties and
min-height: 100vh
to the ``<body>`. Add a little padding to the body that way it stops the component from hitting the edges of the browser.
width: 240px
an explicit width is not a good way to have responsive layout . Consider usingmax-width
to the card inrem
.
height: 350px;
It's not recommended to set height to component, let the content of the component define the height
- Using percentages for widths, using max-width and avoiding to set heights for the components, with these things is the key to mastering responsive layouts.
- Consider using rem and em units as they are flexible, specially for font size better to use rem. If your web content font sizes are set in absolute units, such as pixels, the user will not be able to re-size the text or control the font size based on their needs. Relative units “stretch” according to the screen size and/or user’s preferred font size, and work on a large range of devices.
- Remember a modern css reset on every project. That will do things like set the images to display block and make all browsers display elements the same.
Overall, Excellent work! Hopefully this feedback helps.
Marked as helpful0@MsarthaksharmaPosted about 2 years ago@PhoenixDev22 Hi, Thank you so much for the detailed analysis. I will definitely implement it in my coding. I am learning flex and grid so couldn't use it for now. I have understood everything you mentioned will try to work more hard.
:)
1@PhoenixDev22Posted about 2 years ago@Msarthaksharma
Glad to help . Happy coding!
Marked as helpful1 - You should use
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