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

Responsive Layout using Grid and Flex in SCSS

Rino 340

@Rhinozer0s

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


Hey guys🫡,

I would be very happy when some of you check my code. All suggestions for improvement are welcome. I wrote it in SCSS. You can also find the SCSS-file in my repository.

Thanks, I am grateful for any help 🤝

Community feedback

@faisalahmed11

Posted

Hi there @Rhinozer0s, here are some suggestions from my side.

//replace you body{ } styles with
body {
//width: 100%;
min-height: 100vh;
background-color: hsl(233, 47%, 7%);
display: grid;
place-content: center;
}



// and your @media query  main{ } styles with
.main {
max-width: 75rem;
display: grid;
grid-template-columns: repeat(2, 1fr);
margin-inline: 1rem;
//border: 0;
border-radius: 8px;
overflow: hidden;
}



// and also, replace your  main.picture img{ } styles with
main .picture img {
display: block;
width: 100%;
mix-blend-mode: multiply;
filter: contrast(0.65);
height: 100%;
object-fit: cover;
}

above improvements are especially good for responsiveness.

Marked as helpful

0

Rino 340

@Rhinozer0s

Posted

Thanks @faisalahmed11,

but why are you removing the width for the body? The object-fit advice was a good one!

0

@faisalahmed11

Posted

@Rhinozer0s, according to my knowledge by default block-level elements have width:100%, and here body {} is also a block-level element.

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