nixoncode / nft-preview-card-component-main

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend Mentor - NFT preview card component solution

This is a solution to the NFT preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

Here's a brief overview of the project

The challenge

Users should be able to:

  • View the optimal layout depending on their device's screen size
  • See hover states for interactive elements

Screenshot

screenshot

Links

My process

  1. Started off writing HTML
  2. Add CSS starting from base styles
  3. Added most css to achieve layout structure
  4. Add minimal tweaks

Built with

  • Semantic HTML5 markup
  • Vanilla CSS
  • CSS variables
  • Flexbox
  • No javascript

What I learned

I can center a div with CSS - yay!

To see how you can add code snippets, see below:

<body>
  <section class="preview">
    ...
  </section>
</body>
section.preview {
    flex: 1;
    align-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

Continued development

  • Responsive layout – This challenge specified break points but I did not find anywhere to use it

  • Better naming – Css class names could definitely improve

  • CSS reusability - I tried to re-use most of CSS but still had a challenge, it could be more leaner

  • Cascading styles – Say for example I have the following

start of file

a {
  text-decoration: none;
  color: pink;
}

a:hover {
  color: deeppink;
}

somewhere along the way

.footer a {
  color: fuchsia;
}

I expected the hover styles to still work, even for the footer links but it stopped.

Still need to figure that out

Useful resources

  • CSS Scan - This helped me to copy and paste box shadows for cards.

Author

Acknowledgments

To all the creators who put out content for free. Thank you

About


Languages

Language:CSS 53.6%Language:HTML 46.4%