Design comparison
Solution retrospective
live link doesn't render correctly in chrome but does in firefox, safari, sigmaos
Community feedback
- @MelvinAguilarPosted over 1 year ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
CSS π¨:
- You should use a CSS reset. A CSS reset is a set of CSS rules that are applied to a webpage in order to remove the default styling of different browsers.
-
You should use the
box-sizing: border-box
property to make thewidth
andheight
properties include the padding and border of the element. This will make it easier to calculate the size of an element. You can read more about this here π.Your styles indicate a width of
width: 300px;
for the component, but if you inspect the element, the actual width is 332px, 32px more that are part of the padding and border.
-
Update the image selector to make responsive images.
.card { /* NOTE: Only use the card selector here */ border-radius: 0.75em; width: 300px; } img.qr-code { max-width: 100%; display: block; }
I hope you find it useful! π
Happy coding!
Marked as helpful1 - @maykol-vallejosPosted over 1 year ago
Hi, I was reviewing your code and I have some suggestions to make:
-The first one is that you should use a CSS reset to remove the default styling of the different browsers. I think a previous comment mentioned it to you, for that you could use the following code:
*{ margin: 0 padding: 0; box-sizing: border-box; }
- Once the CSS is reset, you can center your card with flexbox or grid, in this case use grid to center it in your code, add the following code to your stylesheet and it will be centered for any responsive browser:
body{ display: grid; place-items: center; min-height: 100vh; }
-Lastly I would like to suggest you to try not to use "px", it is a bad practice when you are just starting in responsive web scope, especially with font size, for that I recommend you the 62.5% trick, you can check it in the following link:
https://www.aleksandrhovhannisyan.com/blog/62-5-percent-font-size-trick/
I hope the suggestion helps you, congratulations for your coding, keep it up, success in future projects!
Marked as helpful0 - @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 due to
non-semantic
markup, which lack landmark for a webpage
- So fix it by replacing the element
<div class="card">
the with semantic element<main>
along with<div class="attribution">
the with semantic element<footer>
in yourindex.html
file to improves 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
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
Marked as helpful0
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