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 using CSS Flexbox

s4nd0β€’ 320

@s4nd0

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


I didn't know how to change color of the image so it would be nice if someone could help. I would like to get criticism and know what I am doing wrong so that I can improve it in the future.

Community feedback

@VCarames

Posted

Hey there! πŸ‘‹ Here are some suggestions to help improve your code:

  • The only heading ⚠️ in this component is the β€œGet insights that help your business grow” everything else will be wrapped in a paragraph element.
  • The statistics at the bottom are a list ⚠️, so it should be built using an unordered List element.

More Info: πŸ“š

MDN <ul>: The Unordered List element

  • This challenges requires the use of two images πŸŽ‘ at different breakpoints. ⚠️ The picture element will facilitate this.

Syntax:

  <picture>
    <source media="(min-width: )" srcset="">
    <img src="" alt="">
  </picture>

More Info: πŸ“š

https://www.w3schools.com/html/html_images_picture.asp

  • The β€œimage” in this component are purely decorative. ⚠️ Their alt tag should be left blank to hide them from assistive technology.

More Info:πŸ“š

https://www.w3.org/WAI/tutorials/images/

If you have any questions or need further clarification, feel free to reach out to me.

Happy Coding! πŸŽ†πŸŽŠπŸͺ…

Marked as helpful

1
Kyrylo Haidukβ€’ 420

@superpooperxxx

Posted

Hi, I am not sure how to make it with actual <img>, but it is easy to do with background-image.

Your right side can be just <div> with a height 100% and lets say width 40%. Then add image as a background-image like this

background-image: 
  #purple(but make it rgba, to het this transparency), 
  url("./path to image")

Marked as helpful

1
Hassia Issahβ€’ 50,830

@Hassiai

Posted

For the color of the image, in the html wrap the img in a div and give the div a class for the styling. <div class="stat-image"><img><img></div>

Give .stats-image a background-color of soft violet and give the img a width of 100%, height of 100% object-fit of cover , a mix-blend-mode of multiply and opacity of 0.8.

.stats-image{
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

1
Jeanco Volfeβ€’ 460

@engsofjvolfe

Posted

Hey... nice there...

To change the color of the image you need to set a background color for the "container" where the image is, so you change the opacity of the image. Doing this way you can see the color of the "container"where the image is set.

An example would be (CSS):

.container-img {
     background-color: var(--softViolet);
}

.container-img>.img-mobile,
.container-img>.img-desktop {
    opacity: 0.6;
}

Try something like this, adapt to your own code... if you don't get it, i can provide an answer based on your own coding. Apologize the bad english...

See you.. Happy coding

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