Skip to content

A small Frontend Mentor challenge. Single card using CSS Flex-box. Learned: overlay an image with an icon using relative and absolute properties. Also hover pseudo elements.

Notifications You must be signed in to change notification settings

John-Davidson-8/fem-nft-component-card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

-Create a card containing images and icons.

Screenshot

image of nft card

Links

My process

  • Used Visual Studio Code, Figma and Firefox Developer Edition

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • CSS Flexbox

What I learned

-In this project, pure CSS and flexbox were used. Flexbox is a one-dimensional layout system to make web design responsive, and it provides that the elements can change their behavior depending on the kind of device displaying them. Additionally, it makes elements flexible and provides them with appropriate position, and symmetry. Thus, responsive web pages are able to be designed and built without having to use a lot of float and position properties in the CSS.

Interesting code

  • Below is code to spread images and text horizontally
<div class="flex-group">
  <div class="product__price">
    <img src="./images/icon-ethereum.svg" alt="etherium icon" />
    <p>0.041 ETH</p>
  </div>
  <div class="product__time">
    <img src="./images/icon-clock.svg" alt="clock" />
    <p>3 days left</p>
  </div>
</div>

-Below is CSS to flex align all contents from top to bottom.

.card {
  background-color: var(--primary-4);
  border-radius: 0.5rem;
  width: 327px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

Continued development

I need to learn how to add an SVG image/icon to the centre of another image.

Useful resources

Author

About

A small Frontend Mentor challenge. Single card using CSS Flex-box. Learned: overlay an image with an icon using relative and absolute properties. Also hover pseudo elements.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published