DEV Community

Cover image for Challenge 2 - Product preview card component - Frontend Mentor
Abhishek Baliyan
Abhishek Baliyan

Posted on • Edited on

Challenge 2 - Product preview card component - Frontend Mentor

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

Desktop View

Mobile View

Links

My process

  • First, I See the design then thought, how do I lay that out in html
  • Then I wrote the HTML
  • Second, how can i use CSS to achieve the layout
  • Then I wrote the CSS for layout
  • Third, how should each element be styled
  • Then I wrote CSS for each element

Built with

  • Semantic HTML5 markup
  • CSS
  • Flexbox
  • Mobile-first workflow

What I learned

  • Screen Reader - Visually hide
  • How to add img/icon on button

Continued development

  • CSS Grid
  • In depth CSS

Useful resources

Author

Acknowledgments

The stackoverflow guide of image replacing by css solved my problem.

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️