@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
adisplay: flex
andflex-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
withalign-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