How to show random color on hover in CSS?

前端 未结 5 1471
清歌不尽
清歌不尽 2021-01-17 16:00

I have this CSS code that only displays one color (blue) when there\'s a mouse hover.

.MenuBox {
    transition: all 1.0s ease;
    -moz-border-radius:30px;
         


        
5条回答
  •  再見小時候
    2021-01-17 16:46

    You could use jQuery to select the element you want to hover over and execute a function that generates random hex codes. Then set the div's color to what is generated.

提交回复
热议问题