Live site Qr-code challenge with CSS and HTML
Design comparison
Solution retrospective
Nothing
Community feedback
- @correlucasPosted about 2 years ago
👾Hi @Aswinchandran2000, congratulations for your first solution!👋 Welcome to the Frontend Mentor Coding Community!
Great solution and great start! By what I saw you’re on the right track. I’ve few suggestions to you that you can consider to add to your code:
Use
<main>
instead of<div>
to wrap the card container. This way you show that this is the main block of content and also replace the div with a semantic tag.Replace the
<h2>
containing the main title with<h1>
note that this title is the main heading for this page and every page needs one h1 to show which is the most important heading. Use the sequence h1 h2 h3 h4 h5 to show the hierarchy of your titles in level of importance, never jump a level.Add a margin of around
margin: 20px
to avoid the card touching the screen edges while it scales down.Use relative units as
rem
orem
instead ofpx
to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.✌️ I hope this helps you and happy coding!
Marked as helpful1@Aswinchandran2000Posted about 2 years ago@correlucas Thanks for the support.Great tips and i will keep in mind about using <main> ,about keeping hierarchy about heading and about the relative units. Happy coding!
0 - @Deepanshu-5288Posted about 2 years ago
HI @ASWIN CHANDRAN, This looks great just a little suggestion which I got from lucas. The approach you've used to center this card vertically is not the best way, because using margins you don't have much control over the component when it scales. My suggestion is that you do this alignment with flexbox using the body as a reference for the container.The first thing you need to do is to remove the margins used to align it, then apply min-height: 100vh to make the body height size becomes 100% of the screen height, this way you make sure that whatever the situation the child element (the container) align the body with display: flex and align-items: center / justify-items: center.
body { min-height: 100vh; margin: 0; background-color: hsl(212, 45%, 89%); text-align: center; display: flex; align-items: center; justify-content: center; }
Hope this helps you
Marked as helpful1@Aswinchandran2000Posted about 2 years ago@Deepanshu-5288 This solution you gave is actually very helpful. This made me refer more about flex-box and I am delighted to try it out. Thanks for the support.
0@Deepanshu-5288Posted about 2 years agoThanks @correlucas for pointing out this I will make sure that any suggestion I give will be my understanding only.
Thanks, Deepanshu
0@Deepanshu-5288Posted about 2 years ago@correlucas that was my negative point just to copy your feedback rather than giving mine own understanding which is not helping me in anything. So, grateful to you that you point it out early.
Thanks, Deepanshu
0@correlucasPosted about 2 years ago@Deepanshu-5288 Thats fine. Here's a great source for your next challenges and feedbacks.
https://css-tricks.com/
1 - @AdrianoEscarabotePosted about 2 years ago
Hi ASWIN CHANDRAN, how are you?
I really liked the result of your project, but I have some tips that I think you will like:
1- Every page should have one main landmark
<main>
. So replace the div that wraps the whole content with<main>
to improve the accessibility. click here2- All page content should be contained by landmarks, you can understand better by clicking here: click here
We have to make sure that all content is contained in a reference region, designated with HTML5 reference elements or ARIA reference regions.
Example:
native HTML5 reference elements:
<body> <header>This is the header</header> <nav>This is the nav</nav> <main>This is the main</main> <footer>This is the footer</footer> </body>
ARIA best practices call for using native HTML5 reference elements instead of ARIA functions whenever possible, but the markup in the following example works:
<body> <div role="banner">This is the header</div> <div role="navigation">This is the nav</div> <div role="main">This is the main</div> <div role="contentinfo">This is the footer</div> </body>
It is a best practice to contain all content, except skip links, in distinct regions such as header, navigation, main, and footer.
Link to read more about: click here
2- Why it Matters
Navigating the web page is far simpler for screen reader users if all of the content splits between one or more high-level sections. Content outside of these sections is difficult to find, and its purpose may be unclear.
HTML has historically lacked some key semantic markers, such as the ability to designate sections of the page as the header, navigation, main content, and footer. Using both HTML5 elements and ARIA landmarks in the same element is considered a best practice, but the future will favor HTML regions as browser support increases.
Rule Description
It is a best practice to ensure that there is only one main landmark to navigate to the primary content of the page and that if the page contains iframe elements, each should either contain no landmarks, or just a single landmark.
Link to read more about: click here
The rest is great!!
Hope it helps...👍
Marked as helpful0 - @ziaddzamelPosted about 2 years ago
HI @ASWIN CHANDRAN, congratulations for your first solution! It is a great start .I’ve few suggestions that well help you to improve improve the accessibility
1.Add the alt text .The alt attribute provides alternative information for an image if a user for some reason cannot view it
2-Use a CSS reset to avoid all the problems you can have with the default CSS setup .I recommend to give a look at : https://piccalil.li/blog/a-modern-css-reset/
✌️ happy coding!
0@Aswinchandran2000Posted about 2 years ago@ziaddzamel Thanks for suggestions.I will keep that in mind.Happy coding!
0
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