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

Responsive-stats-Preview-Card-Component

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


Any Feedbacks about improve the code are welcome :-)

Community feedback

Ahmed Bayoumi 6,740

@Bayoumi-dev

Posted

It looks great Zienab,

My suggestion:

The scrollbar appears on the page that because the body element has a default margin --> margin: 8px;, I suggest you reset all margins & padding.

* {
margin: 0;
padding: 0;
}

This has become a very popular technique. It removes all default margin and padding for every object on the page.

I hope this is useful to you... Keep it up👍

Marked as helpful

0

@zenab12

Posted

@Bayoumi-dev Yes, I know this but I forget to set css Normalization for Page,

  • any tip to use image and fit content more accurate ??
0
Ahmed Bayoumi 6,740

@Bayoumi-dev

Posted

@zenab12 in my opinion.. always when using the image create an element as a wrapper for it and give the image these properties Width: 100%, height: 100% and its wrapper overflow: hidden;, and control the image through its wrapper this gives me more control and more responsively,

in this challenge I styled the image like the following:

<div class="img-wrapper">
            <img src="images/image-header-desktop.jpg" alt="image header">
         </div>
.stats-preview__img-wrapper {
  flex-basis: 48.648%;  
  background-color: var(--colors-soft-violet);
  overflow: hidden;
}
.stats-preview__img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* to resize it to fit its wrapper */
  mix-blend-mode: multiply;
  opacity: 75%;
}

I don't know if it is a perfect way or not but this gives me more control... Good luck!

Marked as helpful

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