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

Jen M 130

@jenmurph4610

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


This was just to be a simple project meant to get me back into the swing of things after a break because of illness. I thought it would take me longer to get my brain back into it, but this ended up coming together fairly quickly and easily. The practice from each previous challenge shows with every new challenge I do, the layout and designs are feeling easier and requiring less googling to complete. Feeling more confident each project when it comes to HTML and CSS.

The only part that gave me any sort of issue was with the hover state on the Learn More buttons. Changing the background color was simple, but changing the text color of the anchor tags on hover stumped me for a few minutes.

I expected to just add "color: white" into each '#section-one .btn:hover' selector where I have the different hover state backgrounds, but the white text did not trickle down to the anchor tag as I expected. I also tried adding the color to a 'btn:hover a' selector because the font color (unlike the background color) was the same for all three so I tried adding it once for all. This did not work either. In the end I had to target .'btn:hover a' for every section ID, replicating it three times in the CSS. I don't quite understand why it was necessary to do it this way yet so if anyone knows, I'd love to hear some tips.

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hello Jen, Congratulations on completing this challenge!

Great code and great solution! I’ve few suggestions for you that you can consider adding to your code:

1.Prefer CLASS instead of ID to give style to your elements, choosing id is not a good idea because it’s a too specific selector and it's better to use it for forms or Javascript code. It is not advisable to use IDs as CSS selectors because if another element in the page uses the same/similar style, you would have to write the same CSS again.

2.To make your CSS code easier to work you can create a single class to manage the content that is mostly the same for the 3 cards (paddings, colors, margins and etc) and another class to manage the characteristics that are different (colors and icon), this way you'll have more control over then and if you need to change something you modify only one class.

✌️ I hope this helps you and happy coding!

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