How to make hover functionality like in Windows 10 settings?
P粉020556231
P粉020556231 2023-09-12 13:02:00
0
1
518

Can someone tell me how to do a hover like this in css?

This is an example of a Windows 10 setup. But I want to replicate it in css.

P粉020556231
P粉020556231

reply all(1)
P粉515066518

You can use multiple gradient background images to get the effect on hover.

This is an example. Obviously, experiment with various settings until you get the look you want.

<style>
  body {
    background: black;
  }
  
  div {
    width: 150px;
    height: 50px;
    color: red;
  }
  
  div:hover {
    background-image: linear-gradient(to right, white, transparent), linear-gradient(white, transparent), linear-gradient(to right, rgba(255, 255, 255, 0.3), 20%, transparent);
    background-size: 100% 1px, 1px 100%, 100% 100%;
    background-position: top left, top left, 1px 1px;
    background-repeat: no-repeat;
  }
</style>

<body>
  <div>Hover here</div>
</body>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!