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 component

@shan0720-creator

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 am a person who has just begin making static website. Please if anyone could correct the mistakes is highly appreciated

Community feedback

Hassia Issah 50,670

@Hassiai

Posted

Replace <div class="card"> with the main tag and <p class="para1"> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html

To center .card on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.

To center .card on the page using flexbox:
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
To center .card on the page using grid:
body{
min-height: 100vh;
display: grid;
place-items: center;
}

You forgot to add a border-radius to the design.

For the color of the image, a background-color of soft violet, a background-blend-mode of multiply and opacity:0.8 to .sub-card.

.sub-card{
background-image: url();
background-size: cover;
background-color: hsl()
background-blend-mode: multiply;
opacity: 0.8;
}

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

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

Marked as helpful

0
SrHatcher 710

@SrHatcher

Posted

Hello Shantanu! You have made a great work here, keep it up :)

to improve your website you can add to the body styles a min-height: 100vh; margin: 0; display: flex; justify-content: center; align-items: center to make the content of your page automatically position in the center of the view, so you can remove the margin-left and margin-top you added to your div with the class card .

since I see you're using a div with class sub-card with background for the image, you can add another div inside that one with a width: 100%; height: 100%; background: hsl(277, 64%, 61%); mix-blend-mode: multiply to try to simulate the purple filter on the image.

and at last i would recommend you to change your div tag with class card for a main tag, since it's the main container of your website. so you can start using semantic HTML.

I hope these recomendations help you, nice work and happy coding :)

Marked as helpful

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