Css3基于 box-shadow的鼠标悬停
来源:互联网 发布:ipad画图软件免费 编辑:程序博客网 时间:2024/05/18 11:46
<div class="buttons"> <h1>简单的悬停效果基于 <code>box-shadow</code></h1> <button class="fill">Fill In</button> <button class="pulse">Pulse</button> <button class="close">Close</button> <button class="raise">Raise</button> <button class="up">Fill Up</button> <button class="slide">Slide</button> <button class="offset">Offset</button></div>
<style> .fill:hover, .fill:focus { box-shadow: inset 0 0 0 2em var(--hover); } .pulse:hover, .pulse:focus { -webkit-animation: pulse 1s; animation: pulse 1s; box-shadow: 0 0 0 2em rgba(255, 255, 255, 0); } @-webkit-keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--hover); } } @keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--hover); } } .close:hover, .close:focus { box-shadow: inset -3.5em 0 0 0 var(--hover), inset 3.5em 0 0 0 var(--hover); } .raise:hover, .raise:focus { box-shadow: 0 0.5em 0.5em -0.4em var(--hover); -webkit-transform: translateY(-0.25em); transform: translateY(-0.25em); } .up:hover, .up:focus { box-shadow: inset 0 -3.25em 0 0 var(--hover); } .slide:hover, .slide:focus { box-shadow: inset 6.5em 0 0 0 var(--hover); } .offset { box-shadow: 0.3em 0.3em 0 0 var(--color), inset 0.3em 0.3em 0 0 var(--color); } .offset:hover, .offset:focus { box-shadow: 0 0 0 0 var(--hover), inset 6em 3.5em 0 0 var(--hover); } .fill { --color: #a972cb; --hover: #cb72aa; } .pulse { --color: #ef6eae; --hover: #ef8f6e; } .close { --color: #ff7f82; --hover: #ffdc7f; } .raise { --color: #ffa260; --hover: #e5ff60; } .up { --color: #e4cb58; --hover: #94e458; } .slide { --color: #8fc866; --hover: #66c887; } .offset { --color: #19bc8b; --hover: #1973bc; } button { color: var(--color); -webkit-transition: 0.25s; transition: 0.25s; } button:hover, button:focus { border-color: var(--hover); color: #fff; } body { color: #fff; background: #17181c; font: 300 1em 'Fira Sans', sans-serif; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -ms-flex-line-pack: center; align-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; text-align: center; min-height: 100vh; display: -webkit-box; display: -ms-flexbox; display: flex; } button { background: none; border: 2px solid; font: inherit; line-height: 1; margin: 0.5em; padding: 1em 2em; } h1 { font-weight: 400; } code { color: #e4cb58; font: inherit; }</style>
阅读全文
0 0
- Css3基于 box-shadow的鼠标悬停
- css3 的 box-shadow
- CSS3的text-shadow和box-shadow
- css3的box-shadow的使用
- CSS3 box-shadow 阴影的使用
- CSS3阴影 box-shadow的使用详解
- css3中box-shadow的使用
- 【CSS3】关于box-shadow的扩展半径
- CSS3阴影 box-shadow的使用总结
- CSS3中box-shadow属性的使用方法
- CSS3 box-shadow div的阴影样式
- css3 box-shadow 属性的使用
- css3 box-shadow
- box-shadow css3学习
- css3 box-shadow
- CSS3 box-shadow 属性
- CSS3 Box-shadow
- CSS3之box-shadow
- 说说seo中的快速排名原理
- 使用canvas实现图片压缩
- TinkerPop中的遍历:图的遍历策略
- eclipse 卡死问题的解决
- windows程序崩溃生成dump文件
- Css3基于 box-shadow的鼠标悬停
- 海量数据挖掘MMDS week3:社交网络之社区检测:基本技巧
- 文字两端对齐、ie谷歌多种浏览器兼容写法
- list多条目加载
- 输入数字,返回数字代表的字母的所有组合
- stm32使用两路串口及接收不定长数据的实现
- python 单例模式
- Spark源码分析之DiskBlockMangaer分析
- Python中format函数用法说明