Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Blog Preview Card CSS Hover Effect

accessibility, animation
P
yinnie•320
@wcyin9
A solution to the Blog preview card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


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

I'm proud of making the solution quite similar to the design, but I feel like there's still areas that are different.

What challenges did you encounter, and how did you overcome them?

I was hesitant on using certain html tags for sectioning layouts. I wasn't sure if aside was necessary.

I also need help with the hover state! I want to trigger the increase in box shadow as well as the change in H1 font color to yellow, but I don't know how to trigger both of them at once. If I add :hover to card container, I can only increase the box shadow.

If I simply add H1:hover, the font change will only trigger when I hover on H1 specifically. How can I change the H1 font color when I hover over the entire card?

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

I think I have a tendency to write redundant code, so if anyone has tips on how I can change my code to be more efficient that would be really helpful. I would also like to know if I chose the right html tags. All other critiques are also welcome!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Bryan Li•3,530
    @Zy8712
    Posted about 1 year ago

    Hi there! To change the color of the <h1> text when you hover over the card you can do something along the lines of:

    main:hover h1{
     	color: #F4D04E;
    }
    

    Hope this helps 👍

    Marked as helpful

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub