<!doctype html> <html> <head> <meta charset="utf-8"> <title>按钮阴影动画效果</title> <style type="text/css"> button { position: relative; display: block; margin: 100px auto; padding: 10px; width: 100px; height: auto; border: none; border-radius: 5px; background: #07c160; color: #fff; text-align: center; text-decoration: none; font-size: 18px; cursor: pointer; } button:hover { -webkit-box-shadow: 0 0 10px #666; box-shadow: 0 0 10px #666; -webkit-transition: .5s; transition: .5s; } button:hover:after { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 5px; background: hsla(0,0%,100%,.1); content: ""; } </style> </head> <body> <button type="button">按钮</button> </body> </html>
Copyright © 2024 码农人生. All Rights Reserved