Design comparison
Community feedback
- @visualdennissPosted over 1 year ago
Hello there,
Good work! I'd have few suggestions. It looks like you are using paddings to center the card but this is not an ideal way to center as you lose control when browser sizes change. Here are my suggestions to refactor the code:
-
Firstly remove padding-top: 5%; padding-bottom: 5%; and add the background-color to the body itself instead of b5-container-fluid.
-
Use GRID or FLEXBOX on body to center the card:
body { background-color: hsl(212, 45%, 89%); display: grid; place-items: center; min-height: 100vh; }
- finally remove margin: 0 40% from .all-items, this causes it to shrink too much. Instead use a value like max-width: 300px (in rem/em) to prevent it getting too big but keeping it flexible.
Hope you find this feedback helpful!
Marked as helpful0 -
- @razalalkhanPosted over 1 year ago
Hi there,
many thanks for the feedback. I am just new to the field like its been 3 weeks only starting to learn things. But i appreciate that you have given me the good advice. I have done changes and it will be uploaded soon. so please check after 5 or 10 minutes again.
Many thanks
Raza Khan
1 - @0xabdulkhaliqPosted over 1 year ago
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.
HTML π·οΈ:
- This solution generates accessibility error reports, "All page content should be contained by landmarks" is due to
non-semantic
markup, which causes lacking of landmark for a webpage
- So fix it by replacing the
<div class="b5-container-fluid">
element with the semantic element<main>
in yourindex.html
file to improve accessibility and organization of your page.
- What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like
<div>
or<span>
- They convey the structure of your page. For example, the
<main>
element should include all content directly related to the page's main idea, so there should only be one per page
HEADINGS β οΈ:
- And, this solution has also generated accessibility error report due to lack of level-one heading
<h1>
- Every site must want at least one
h1
element identifying and describing the main content of the page.
- An
h1
heading provides an important navigation point for users of assistive technologies, allowing them to easily find the main content of the page.
- So we want to add a level-one heading to improve accessibility by reading aloud the heading by screen readers, you can achieve this by adding a
sr-only
class to hide it from visual users (it will be useful for visually impaired users)
iMAGES πΈ:
- Since this component involves scanning the QR code, the image is not a decoration, so it must have an
alt
attribute.
- The
alt
attribute should explain the purpose of theimage
.
- E.g.
alt="QR code to frontendmentor.io"
.
I hope you find this helpful π Above all, the solution you submitted is great !
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