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

Results summary component solution

@aljager1983

Desktop design screenshot for the Results summary component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I am unsure on the grid layout sizing. Its easy to prepare layuot base on the 1440px and 375px screen sizes, but when I switch to bigger screen than 1440px and smaller screen sizes than 375px my layout gets crampy. I followed the youtube video of freecodecamp.org for CSS grid but i think that lecture was just a scratch, would very much appreciate if you could suggest and indepth and clear for beginners tutorial relating to CSS grid or equivalent

Community feedback

@MelvinAguilar

Posted

Hello again, I have some suggestions:

You should use the body element to center the component, and leave the <main> element containing only the two columns. Also use a max-width to prevent the component from getting too large. I haven't done this challenge myself, so I can't help you with exact dimensions. [1]

Using the main element to center it causes the two columns to move away on larger screens.

This line of code is strange: grid-template-columns: repeat(4, 1fr);. Those are four columns, if you observe carefully, you can see that there are only two columns, the "blue" column and the "white" column. It can be perfectly repeat(2, 1fr);. [2]

body { /* NOTE [1]*/
    min-height: 100vh;
    place-content: center;
    display: grid;
}

main {
    /* min-height: 100vh; */
    max-width: 900px;
    display: grid;
    /* place-items: center; */
    /* grid-template-columns: repeat(4, 1fr); */    /* NOTE [2]*/
    grid-template-columns: repeat(2, 1fr);
}

.result {
    /* NOTE: This is not necessary, just by using "repeat(2, 1fr);" you are creating two columns of exactly the same width.*/
    /* max-height: 60%; */
    /* grid-column: 2/3; */
    . . . 
}

.summary {
    /* max-height: 60%; */
    /* grid-column: 3/4; */
} 

The other issue on mobile devices is different. I feel like the breakpoint ("375px") for switching between views is too small.

Lectures:

Happy coding!

Marked as helpful

1

@aljager1983

Posted

@MelvinAguilar hi bro, very much appreaciated you reviews on my solutions. it helps me greatly to be better, i will try to apply your suggestions and tips, as always God bless you and thanks a lot

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