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

Product preview card component

Chris 130

@Cortele

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


First responsive layout project and first attempt at a mobile-first workflow. This project is far from perfect; there are several sizing, spacing issues. I am hoping to receive feedback so I can improve.

Community feedback

Steve 1,170

@peanutbutterjlly

Posted

for the body, add these styles:

display: grid;
place-content: center;
height: 100vh;
}

What that'll do is put the content in the middle and make the body 100% of the view-height; hence using the vw unit.

for your .section__one and .section__two classes, add:

flex: 1

what that flex: 1 property does is set the flex-grow and shrink values to 1 (its a shorthand for flex-grow: 1 and flex-shrink: 1) so both items can grow and shrink at the same time.

you want to add that here so both items can take equal width/space.

With that said, those solutions are for desktop, I didn't see how (or if) it would affect mobile.

good job completing the solution!!!

Marked as helpful

1

@Jazzy486

Posted

You can add the following code to distribute space evenly in the main div

.main{ display: flex; }

For the divs inside the main div

.left-div, .right-div{ width:50%; }

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