Skip to content

Mabchir/nft_preview_card_component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - NFT preview card component solution

This is my solution to the NFT preview card component challenge on Frontend Mentor.

Table of contents

Overview

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

  • Desktop View

  • Desktop View - Active 1 (active image)

  • Desktop View - Active 2 (active title)

  • Desktop View - Active 3 (active name)

Links

My process

Built with

  • HTML
  • CSS custom properties
  • Flexbox

Steps

  • Set up the repository, live site and starter files
  • created a sketch of the different components I will be needing
  • translated sketch into HTML
  • added the class in CSS
  • added relevant styling
  • optimized redundant code (e.g. display: flex)
  • adding hovering styles

What I learned

  • Applied lessons learned in the previous challenge (mainly how to center components to the screen no matter what device in use)
  • how to plan the different components prior to starting coding
  • how to overlay two components and use it as a hovering styling option
  • how to align elements in a flex box using the following code:
.container {
  display: flex;
  align-items: center;
}
  • how to make edits to a div/component while hovering over a different div/component (note that b should come after a)
#a:hover + #b {
  background: #ccc;
}
<div id="a">Div A</div>
<div id="b">Div B</div>

Continued development

  • The active version 1 (hovering over the image) has a weird shaky affect, which I am not sure where it's coming from. Maybe exploring the impact of the CSS visibility attribute would be helpful(fixed).

  • Learning more ways of overlaying different components.

Useful resources

Author

Acknowledgments

Shoutout to the following members of Frontend Mentors whose feedback on my first challenge was very helpful in making this challenge a success :

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages