stats-preview-card-component-main

Please log in to post a comment
Log in with GitHubCommunity feedback
- @georgebleyer
Hello,
Congratulations on completing this challenge. Here are some tips on how you can make the image purple:
In the HTML
<picture></picture>
In the CSS
picture{ background: url("../images/image-header-mobile.jpg"); background-color: hsl(277, 64%, 61%); background-blend-mode: multiply; }
I hope it helped.
Marked as helpful - @Hassiai
Replace <div class="card"> with the main tag to make the page/content accessible. click here for more on web-accessibility and semantic html
To center .card on the page using flexbox or grid instead of margin and position: relative,
- USING FLEXBOX: add min-height:100vh; display: flex; align-items: center: justify-content: center; to the body
body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
- USING GRID: add min-height:100vh; display: grid place-items: center to the body
body{ min-height: 100vh; display: grid; place-items: center; }
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
For the color of the image, wrap the img in a figure tag, give the figure a background-color of soft violet and a height of 100%, object-fit: cover, mix-blend-mode: multiply and opacity: 0.8 .
<figure><img></figure> figure{ background-color: hsl(); } img{ width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; opacity: 0.8; }
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful
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