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

spaceman(og) practice project - Stats preview card component

spacemanOG 120

@SpacemanOG

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


Hi everyone. I struggled with this one in the following two areas:

  1. Giving the Hero Image the Purple tint!
  2. Using the Picture HTML element.

If you have any feedback for me on how I can improve on those areas, I will really appreciate it.

Community feedback

ROCKY BARUA 1,090

@Drougnov

Posted

Hi @SpacemanOG, the design is looking great. Good job.

Use a pseudo-element(::after,::before) to create an overlay on that image container. Like this:

 .heroImage::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background: hsla(277, 64%, 40%, 0.6);
  top: 0;
  left: 0;
}

And don't forget to add position: relative to the heroImage.

You can remove the 'source media' for the 300px width as the img will be shown by default on lower that 1200px width screen.

Hope this helps. Have a good day :)

Marked as helpful

0

spacemanOG 120

@SpacemanOG

Posted

@Drougnov Hi bro. I see that you are from Bangladesh, just like me 🙏

Thanks for the suggestions by the way. I have applied it and updated the code. Had to make some minor adjustments, but I think it is okay now.

1

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