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 Four Card Featured Section

Luca 120

@TofeDev

Desktop design screenshot for the Four card feature section coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I'm proud to have been able to do code the cards and make them looks close as the desing. I would like to do them better next time though.

What specific areas of your project would you like help with?

I would like to know how to move the images to the right (I had to use a margin-left and I know that's probably not the correct way to do)

Community feedback

Atatra 170

@Atatra

Posted

Hi, good job on your solution! It looks good. I'm amazed that it works with only flexboxes :)

Another way to put the image to the right would be :

  • Give your .card a display: flex and flex-direction: column property.
  • Since each child of the card is now on a single row, if you want to put the img on the far end of the row, you can style your img with align-self: flex-end. We use align-self to align the img horizontally because the main axis is now the y-axis (column). So the secondary axis is the horizontal one. The div that contains the img would be unnecessary as well.

Also you don't need to add a div for the top color of your cards, you can directly use the border-top attribute.

Marked as helpful

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