1 Star 0 Fork 397

Plaid/html_css_demo

forked from YanH/html_css_demo 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
8.css 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
YanH 提交于 2021-10-21 01:32 +08:00 . 首次提交
*{
/* 初始化 取消页面的内外边距 */
margin: 0;
padding: 0;
}
body{
/* 弹性布局 让页面元素水平、垂直居中 */
display: flex;
justify-content: center;
align-items: center;
/* 设置body高度为100%窗口高度 */
height: 100vh;
background: #000;
}
a{
/* 相对定位 */
position: relative;
width: 400px;
height: 100px;
line-height: 100px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
font-size: 24px;
color: #fff;
/* 渐变背景 */
background: linear-gradient(to right,#03a9f4,#f441a5,#ffeb3b,#09a8f4);
/* 背景渐变色大小 */
background-size: 400%;
/* 圆角 */
border-radius: 50px;
z-index: 1;
}
/* 发光效果 */
a::before{
content: "";
position: absolute;
top: -5px;
left: -5px;
bottom: -5px;
right: -5px;
/* 渐变背景 */
background: linear-gradient(to right,#03a9f4,#f441a5,#ffeb3b,#09a8f4);
/* 背景渐变色大小 */
background-size: 400%;
/* 圆角 */
border-radius: 50px;
/* 位于按钮之下 */
z-index: -1;
/* 设置模糊度 显示发光效果 */
filter: blur(20px);
}
/* 鼠标移入执行动画 */
a:hover{
/* 动画:名称 时间 infinite是无限次播放 */
animation: streamer 8s infinite;
}
a:hover::before{
animation: streamer 8s infinite;
}
/* 接下来定义动画 */
@keyframes streamer{
100%{
/* 背景位置 */
background-position: -400% 0;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/plaidweb/html_css_demo.git
git@gitee.com:plaidweb/html_css_demo.git
plaidweb
html_css_demo
html_css_demo
master

搜索帮助