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

HTML & CSS based on pixspy.com inputs

@1aleksa

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


  1. How do you color the image in purple? (I was trying with filter & overlay, however it gives me the same color)

  2. When I resize the desktop view of the website, class="description" starts changing the width and it messes up the visual presentation of the divs. How do I keep them in the same ratio?

Community feedback

P
Grace• 27,950

@grace-snow

Posted

I am seeing the desktop version and it looks very broken on mobile landscape.

The bigger issues with this though, are with the html.

  1. The semantics don’t make sense using h2s for numbers. They need to be in the same semantic element as the word, as both should be read out together. Eg use a list item or a paragraph around both, then use a span or strong tag around the number to target styling

  2. you should not have duplicate html. This is bad for search engines, bad for performance, and completely unnecessary. Instead just change the styling with css. All that needs to change in this is a max-width, flex-direction and text alignment in one media query

I hope this helps

1

@1aleksa

Posted

@grace-snow Hey, thanks for the detailed feedback. Regarding the point 2) I couldn't figure out how to change the order of the layout on mobile screen. When I was searching for it I found on StackOverflow where someone explained with doubling the html (which didn't seem to be very practical). After checking flex-direction what you wrote, now I got an idea how it could be solved just with css. Thanks a ton!

0
P
Grace• 27,950

@grace-snow

Posted

For the image colour you can use mix-blend-mode if image is in html, or background blend mode of its a bg image. That set to multiply and a little opacity should do it

1
Liam R• 425

@Cooly-o-Cats

Posted

For the image overlay, this is what I did:

HTML:

<div class="image">
            <div class="img-cover"></div>

CSS:

.image{
    background-image: url(https://github.com/Cooly-o-Cats/StatsPreviewCard/blob/main/Stats%20Preview%20Card/Assets/img/Assets/image-header-desktop.jpg?raw=true);
    width: 100%;
    height: 100%;
}
.img-cover{
    width: 100%;
    height: 100%;
    background-color: hsla(277, 69%, 35%, 0.73);

}
1
Liam R• 425

@Cooly-o-Cats

Posted

Like it, but did you do the mobile version? It doesn't seem very responsive.

1

@1aleksa

Posted

@Cooly-o-Cats yeah, for the display below 400px desktop elements disappear and the mobile one is there (with the fixed width 375px). You don’t see the mobile version?

0
Liam R• 425

@Cooly-o-Cats

Posted

@1aleksa Seems to be working Now!

1

@1aleksa

Posted

@Cooly-o-Cats okay, thanks. And thanks for the image overlay comment, I’ll check it out

0

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