Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

NFT preview card component Solution

Mohammed ifhamβ€’ 130

@mail2ifham

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi, another challenge was completed. any feedbacks are welcome. More specifically CSS layout and HTML semantics. Thanks

Community feedback

Hassia Issahβ€’ 50,670

@Hassiai

Posted

wrap <div class="attribution"> within the footer tag to fix the accessibility issues.

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.

To center .main on the 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;
}

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

For a responsive content replace the width in .main with max-width.

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

Marked as helpful

0
Francisco Carrilloβ€’ 5,540

@frank-itachi

Posted

Hello there πŸ‘‹. You did a good job!

I have some suggestions about your code that might interest you.

HTML πŸ“„:

  • Wrap the <div class="attribution">' inside the <footer>` tag.

CSS🎨:

  • You can use grid or flexbox to center the content no matter the viewport size. Using grid you can do the following:
body {
min-height: 100vh;
display: grid;
align-items: center;
justify-content: center;
}

With flex:

body {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
  • Avoid using absolute length units px, especially for font-size and width properties, because they are not relative to anything else so that means they will always be the same size. Instead, you can use relative lengths like em or rem. The benefit of that last one is element which has that unit will scale relatively to everything else within the page, e.g., the parent container. You can dig up about it here

I hope you find it useful! 😁😁 Above all, the solution you submitted is greatπŸ‘Œ!

Happy <coding /> 😎!

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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