PricingBlog

How to make a div background change on mouse over?

  • mesmoiron-1276491513106399265

    mesmoiron

    1 year ago

    Hello,

    I found this snippet:
    .div_hover {
    background-color: #FFFFFF;
    }

    .div_hover:hover {
    background-color: #000000;
    }


    But implementing it in a style component did not work; I guess I have missed something. The div has a shadow and I want either the border flash up or change the background slightly. I placed the styling under the div that should be affected. Any suggestions?
  • Tod-1276491514268221478

    Tod

    1 year ago

    Great energy @mesmoiron! Your continuous contribution to the toddle Community just made you advance to Community Level 2!
  • mesmoiron-1276518077478993951

    mesmoiron

    1 year ago

    Awesome, I figured it out with some unexpected luck. Turns out quite simple by naming the css style component after the css verb. Thus, I only needed to set the style diamand to hover and then chose the background color below. Easy peasy 😂