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

3 column preview card

P
Matt 50

@Matt-LaRochelle

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I was unsure if I got the spacing right on a desktop because "off-road" was wrapping at the hyphen, which was not happening in the example. I decided to add white-space: nowrap to a span around those two words in order to keep them on the same line. Does anyone see any spot where I went wrong that may have affected this or is this part of the solution?

Otherwise, I think I got it! Any feedback is always valued and appreciated, Thanks! Matt

Community feedback

Daniel 🛸 44,230

@danielmrz-dev

Posted

Hello Matt!

Your project looks great! Beautiful and responsive.

I have a tip that might help you:

  • You can add height: 100vh to your body tag on your desktop version. Doing that, you won't need margins to center the card.

Other than that, great job. Both desktop and mobile versions are perfect 👌🏼

0

P
Matt 50

@Matt-LaRochelle

Posted

@danielmrz-dev Hi Daniel,

I really appreciate your feedback, but I don't understand how this helps... If I add height:100vh to the body tag then when I shrink the window vertically on desktop, or when I look on a phone in a horizontal mode, it cuts off a lot of the main element. I think I prefer my own way as it works on all screens I tried it on. Please let me know though if I'm mistaking what you have written!

Thank you! Matt

1
Daniel 🛸 44,230

@danielmrz-dev

Posted

Hey @Matt-LaRochelle

Adding height: 100vh to the body tag along with

display: flex;
flex-direction: column;
place-items: center;

is a technique we use to center elements in the middle of the page without using margins.

This is not working for you because your card has a margin-top: 100px and your footer has a margin: 40px auto 15px;.

All those margins use space that was supposed to be occupied by your card. This is why it cuts off parts of your main element sometimes.

0
P
Matt 50

@Matt-LaRochelle

Posted

@danielmrz-dev I see, thank you for your feedback! The place-items rule will definitely come in handy, I didn't know how that one works.

After making the changes, I still was running into the problem where if the window is vertically too short it won't let me scroll to see the rest of the card.

I found a solution though - on the main element I had used overflow: hidden in order to have the border radius working. I added overflow-y: scroll and now everything is working properly.

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