Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Stats preview card component - Fluid Layout with TailwindCSS

Stephen Yu 150

@StephenYu2018

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


As you can see when comparing my design to the one in the given design image, it's not quite there yet. I tried using :before for the overlay and adjusted it with CSS filters, but after a few hours, I gave up and stuck with what I had. I feel like CSS filters would make this convenient, but it's difficult to choose a color with specific RGB/HEX/HSL values. Is there a more convenient way to use a color overlay on an image?

Community feedback

Josh 1,070

@josh76543210

Posted

Hello @StephenYu2018,

Here is an idea for how to create an image overlay:

.card-img {
  background-image: linear-gradient(
      rgba(66, 9, 102, 0.6),
      rgba(66, 9, 102, 0.6)
    ), url("images/image-header-desktop.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

This is what I used for my solution. If you are interested you can check it out here.

Happy Coding!

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord