Responsive-stats-Preview-Card-Component
Design comparison
Solution retrospective
Any Feedbacks about improve the code are welcome :-)
Community feedback
- @Bayoumi-devPosted over 2 years ago
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
andpadding
for every object on the page.I hope this is useful to you... Keep it up👍
Marked as helpful0@zenab12Posted over 2 years ago@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@Bayoumi-devPosted over 2 years ago@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 wrapperoverflow: 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 helpful1@zenab12Posted over 2 years ago@Bayoumi-dev Thanks so Much It's very Helpful
0
Please log in to post a comment
Log in with GitHubJoin 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