84669 人學習
152542 人學習
20005 人學習
5487 人學習
7821 人學習
359900 人學習
3350 人學習
180660 人學習
48569 人學習
18603 人學習
40936 人學習
1549 人學習
1183 人學習
32909 人學習
有人可以告訴我如何在 css 中進行這樣的懸停嗎?
這是 Windows 10 設定的範例。但我想在 css 中複製它。
您可以使用多個漸層背景圖像來獲得懸停時的效果。
這是一個例子。顯然,請嘗試各種設置,直到您獲得想要的外觀為止。
<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>
您可以使用多個漸層背景圖像來獲得懸停時的效果。
這是一個例子。顯然,請嘗試各種設置,直到您獲得想要的外觀為止。