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 component css html

Dean Hudek 290

@deksa89

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


Most difficult thing do create was to do (and I failed) change color on hover on buttons and letters inside buttons. I think I am missing out something here. It shouldn't be that complicated, I think. :D

Community feedback

P
Marge C. 440

@msunji

Posted

Hiya Dean! Great job! 👍

You're right about it not having to be too complicated. Here's how to simplify things a bit. First off, I noticed you used id's, you can use classes instead. The logic here is:

  • Aside from the text colour, your buttons all have the same base style - the same size, padding, etc. You can use the button selector, or make a class that you'll use for all three buttons. (Note: in this explanation, I'll use the button selector instead of a class, but you can definitely have two or more classes for an element).
  • Set your base styles. You'll also want to set a border that's the same colour as the button's background colour, so something like: border: 2px solid #fff;
  • To change the button's colour on hover, instead of setting the background colour for each button, you can do this instead:
button:hover {
  background: transparent;
  color: #fff;
}
  • Last but not least, to change the text colour for each button, you'll want to make a class for each button. Maybe something like button-sedan, button-suv, etc. Then for each class, set the colour accordingly.

That should help reduce/simplify the amount of CSS you've written. Hope you find this helpful!

Marked as helpful

1

Dean Hudek 290

@deksa89

Posted

@msunji Thank you Marge that was really helpful!!! :D

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