Skip to content

My very first front end challenge from Frontend Mentor.io to implement HTML and CSS.

License

Notifications You must be signed in to change notification settings

MartyOfMCA/frontend-mentor-challenge-one

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Product preview card component solution

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

Table of contents

Overview

The challenge

Users should be able to:

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

Screenshot

Design preview for the Product preview card component coding challenge - Desktop Mode

Design preview for the Product preview card component coding challenge - Mobile Mode

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS (Custom Properties)
  • Flexbox
  • Mobile-first workflow

What I learned

Manipulating an element using CSS custom properties was pretty exciting. I could easily change the background image for a div really easily. Custom properties are fun and can be used to solve tons of problems I could have used JavaScript to solve.

<div class="awesome"></div>
.awesome {
  --bg-img: url("path to mobile image");
  background-image: var(--bg-img);
}

@media (min-width: 760px) {
  .awesome {
    --bg-img: url("path to desktop image");
  }
}

Useful resources

  • Kevin Powell - Really helped shaped my understanding in modern CSS design. I would definetely recommend him to anyone who really wants to step up their CSS game.

Author

About

My very first front end challenge from Frontend Mentor.io to implement HTML and CSS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published