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

Semantic HTML, CSS logical properties, CSS Flex Bob

#semantic-ui

@shahrokh0796

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


There wasn't anything noticeably difficult while creating this mini project. One thing that I would like to add about difficulty is when hovering the image, the image had to get covered by cyan color with some opacity. Where I used before pseudo element to get it right. I am not unsure of any part of the code but, my request is that please check and if, there is anything that I can do to make my projects better in future do let me know.

Thank you.

Community feedback

Alamin 1,960

@CodePapa360

Posted

Hi @shahrokh0796👋 Great job on completing this challenge! 🥳

I would like to share a few suggestions on this solution if you don't mind.

  • One issue with the HTML code is that the <link> elements do not have a referrerpolicy attribute. It is a good practice to include a referrerpolicy attribute to control the behavior of the Referer HTTP header. For example, you can use referrerpolicy="no-referrer" to prevent the Referer header from being sent.

  • In the CSS, the :root element is used to define global variables, but it would be more efficient to use custom properties directly in the styles that use them, rather than defining them all in the :root element. For example:

body {
  background-color: var(--color-main-bg);
}

Some suggestions for improving the CSS:

  • Use more semantic class names. For example, instead of using a class name like .card-description, consider using a class name like .product-description that more accurately describes the purpose of the element.

  • Use the rem unit instead of px for font sizes and other layout properties. The rem unit is based on the root element's font size, so it is more flexible and easier to maintain than using fixed pixel values.

  • Consider using a CSS preprocessor like Sass or Less to make it easier to write and maintain your styles. Preprocessors allow you to use features like variables, mixins, and functions to write cleaner, more organized CSS.

  • Use the @media rule to specify styles for different media types or screen sizes. This can help make your website more responsive and user-friendly on different devices.

  • Use the box-sizing property to control the size of an element and its padding and borders. The border-box value allows you to specify the dimensions of an element using the inline-size and block-size properties, rather than having to calculate the size of the element's content and padding separately.

Overall, this is a very well done solution to the challenge. Great job!

I hope this feedback was helpful. 😊 Keep up the good work!👍

Marked as helpful

1

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