Frontend Mentor - Stats preview card component solution

This is a solution to the Stats 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

Screenshot

Links

My process

Built with

  • HTML
  • CSS
  • Bootstrap 5
  • Semantic HTML5 markup

Note: These are just examples. Delete this note and replace the list above with your own choices

What I learned

The main learning points for me was the use of CSS and Bootstrap, and mobile-responsiveness development.

As someone who finds flexbox more intuitive, trying to learn the grid system as a "hacky" way of creating a mobile-friendly page was a challenge. Not to mention the fact that I am still relatively new to Bootstrap, I found myself frustrated at times over seemingly easy tasks.

A major learning point for me was the use of padding. Rather than relying on setting height: 100%, I realized the use of padding allows me to centralize elements equally well. In fact, when I used the attribute height, I encountered many problems getting my elements' height to stay consistent across multiple viewport widths. Specifically, I had issues sitting the image nicely in the card. These issues were ultimately solved with the use of padding and removing height attributes.

Continued development

As this project is of newbie difficulty, and I struggled even with simple centering and managing Bootstrap grid system, I definitely have a long way to go with becoming more proficient with making mobile-friendly websites and using Bootstrap effectively. Thus, these are the 2 areas I will continue to focus on.

Author