Design comparison
Community feedback
- @visualdennissPosted over 1 year ago
Hey Anina,
your solution looks good overall!
I ve few suggestions to improve it even further:
It looks like you have set font-weight: 700; for the p as well, which is not needed since it is not a title. There seems to be some default padding and margin on the page. You can use
- { margin: 0, padding: 0, box-sizing: border-box; } , * will make it apply to all elements on the page.
Hope you find this feedback helpful!
Marked as helpful0 - @HassiaiPosted over 1 year ago
Replace <div class="content-area"> with the main tag and <p class="header"> with <h1> to fix the accessibility issue. click here for more on web-accessibility and semantic html
Add the alt attribute
alt=" "
to the img tag and give it a value to fix the error issue. The value of the alt attribute is the description of the image. For decorative images like icons, there is no need to give it an alt value, for more on alt attribute Click here.There is no need to give the body a height value.
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
There is no need to style qr-card and .content-area, rather give .content area a fixed max-width value, a padding value for all the sides, a background-color of white and a border-radius value.
max-width:320px padding:16px
.Give the img a max-width of 100% for a responsive image instead of width for a responsive image and give it a border-radius value.
Give h1 and p the same font-size of 15px which is 0.9375rem and the same margin-left, margin-right and margin-top values. Give p a margin bottom value.
To center .content-area on the page using flexbox or grid instead of margin, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
USING FLEXBOX: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
USING GRID: body{ min-height: 100vh; display: grid; place-items: center; }
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0 - @Akhil-NagpalPosted over 1 year ago
Hi Anina! π Congratulations on completing your first challenge! π
I've some suggestions regarding your code
- You should use External CSS files instead of using Internal or Inline. This practice will make your HTML file have a cleaner structure and become small in size. Read this for a better understanding π Inline vs internal vs external CSS
- Use Flexbox or Grid for positioning anything on the web page. This will make your code more responsive. π Should we use Flexbox or Grid?
- Use relative units like
em
&rem
instead of absolute units likepx
, because usingem
&rem
will add responsiveness. Read this π Should we use Rem, Em, or Pixel? - The size of the card is also not correct, use
width: 20rem; height: 31rem;
, this will fix the size of the card.
Otherwise! You did a great job! Well Done! π
I hope you will find this useful! π
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