css实现6种按钮悬浮动画效果代码
代码语言:html
所属分类:悬停
代码描述:css实现6种按钮悬浮动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> html,body { margin:0; padding:0; width:100%; height:100%; background:#2c3e50; font-family:"Montserrat",sans-serif; font-size:16px } body { display:flex; flex-wrap:wrap; justify-content:space-around; align-items:center; align-content:center } h1 { color:#f1c40f; font-size:4rem; text-transform:uppercase; display:block; width:100%; text-align:center } @media screen and (max-width:600px) { h1 { font-size:3rem } }p { color:#f1c40f; font-size:1.2rem; width:100%; padding:20px; text-align:center } .btn { box-sizing:border-box; -webkit-appearance:none; -moz-appearance:none; appearance:none; background-color:transparent; border:2px solid #e74c3c; border-radius:.6em; color:#e74c3c; cursor:pointer; display:flex; align-self:center; font-size:1rem; font-weight:400; line-height:1; margin:20px; padding:1.2em 2.8em; text-decoration:none; text-align:center; text-transform:uppercase; font-family:"Montserrat",sans-serif; font-weight:700 } .btn:hover,.btn:focus { color:#fff; outline:0 } .first { transition:box-shadow 300ms ease-in-out,color 300ms ease-in-out } .first:hover { box-shadow:0 0 40px 40px #e74c3c inset } .second { border-radius:3em; border-color:#1abc9c; color:#fff; background-image:linear-gradient(to right,rgba(26,188,156,0.6),rgba(26,188,156,0.6) 5%,#1abc9c 5%,#1abc9c 10%,rgba(26,188,156,0.6) 10%,rgba(26,188,156,0.6) 15%,#1abc9c 15%,#1abc9c 20%,rgba(26,188,156,0.6) 20%,rgba(26,188,156,0.6) 25%,#1abc9c 25%,#1abc9c 30%,rgba(26,188,156,0.6) 30%,rgba(26,188,156,0.6) 35%,#1abc9c 35%,#1abc9c 40%,rgba(26,188,156,0.6) 40%,rgba(26,188,156,0.6) 45%,#1abc9c 45%,#1abc9c 50%,rgba(26,188,156,0.6) 50%,rgba(26,188,156,0.6) 55%,#1abc9c 55%,#1abc9c 60%,rgba(26,188,156,0.6) 60%,rgba(26,188,156,0.6) 65%,#1abc9c 65%,#1abc9c 70%,rgba(26,188,156,0.6) 70%,rgba(26,188,156,0.6) 75%,#1abc9c.........完整代码请登录后点击上方下载按钮下载查看
网友评论0