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

Card Preview

@mahmudofficial1

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


reply to help me make this better in any way Thanks

Community feedback

Sandro 1,170

@sandro21-glitch

Posted

Hi Mahmud

Here are some suggestions to improve your code

Use semantic HTML elements:

Instead of using a <section> element for the card, you could use an HTML5 semantic element such as <article> or <figure> which would better describe the purpose of the element.

Use CSS classes effectively:

You have used the same <br> tag multiple times to create spaces, instead you can use CSS classes to control the spacing.

Use CSS reset:

Instead of writing the CSS reset code manually, consider using a popular CSS reset stylesheet such as Normalize.css or Eric Meyer's Reset CSS.

Minimize the use of hardcoded values:

Instead of using hardcoded values like 5% for margins and paddings, consider using a relative value such as 1rem or a CSS grid/flexbox to create the layout.

Avoid over-qualified selectors:

Over-qualified selectors (e.g., .text-area h3) can make the code longer and harder to maintain. Consider using more specific class selectors where possible.

Happy Coding

Marked as helpful

1
Hassia Issah 50,810

@Hassiai

Posted

Replace <section class="nft-card"> with the main tag and <h3> with <h1> to fix the accessibility issues.

To center .nft-card on the page using grid, add min-height:100vh to the body and remove the padding values in the body.

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

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

0
Muhammadh 1,140

@Mr-jaw

Posted

Hello @mahmudofficial1

I think it would look good by centering the component to the middle of the page. Add this to you body element in CSS. This should help

body {
height: 100vh;}

add some alt text for the img tag in div with the class nft-card. It would be great for accessibility

I hope this was useful 😊. also Congratulations on completing the challange.

HAPPY CODING!

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