作为一个频繁对博客进行改进的人,我深知花里胡哨的CSS效果对于吸引读者尤为重要。在这里,我汇总了一些炫酷的CSS效果,并提供了简要的预览和实现思路,以方便那些不太熟悉的朋友也能轻松上手。同时,我会持续寻找优秀的效果,逐步添加到博客中,其中部分资源来自网络。
相信有了以下示例,很多不会css动画效果的朋友,也就会了
04 第一个字符串生成文字图标
第一个字符串生成文字图标第一个字符串生成文字图标
用CSS可以做什么?用CSS可以做什么?
前端的致命诱惑前端的致命诱惑
*{
margin: 0;
padding: 0;
list-style: none;
transition: .5s;
}
html,body{
background-color: #f5f5f5;
color: #fff;
font-size: 14px;
}
.app{
width: 100%;
height: 100vh;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.app ul {
max-width: 300px;
}
.app ul li{
width: 100%;
color: #152239;
font-size: 16px;
line-height: 42px;
margin: 15px 0;
float: left;
}
.app ul li span{
width: 42px;
height: 42px;
line-height: 40px;
color: #1E47ED;
font-size: 18px;
font-weight: 700;
text-indent: 12px;
border-radius: 50%;
display: block;
float: left;
overflow: hidden;
background-color: #eaeaea;
letter-spacing: 20px;
margin-right: 15px;
}
好看的呼吸灯效果
*{
margin:0;
padding: 0;
}
body,html{
background-color: #000;
}
.app{
width:100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
span{
width: 60px;
height: 60px;
margin: 40px;
border-radius: 50%;
}
.red{
animation: just1 2s ease-in-out infinite alternate;
}
.green{
animation: just2 3s ease-in-out infinite alternate;
}
.blue{
animation: just3 4s ease-in-out infinite alternate;
}
@keyframes just1{
0%{
border: 5px solid rgba(255,0,0,0);
box-shadow: 0 0 0 rgba(255,0,0,0),0 0 0 rgba(255,0,0,0) inset;
}
100%{
border: 5px solid rgba(255,0,0,1);
box-shadow: 0 0 70px rgba(255,0,0,0.7),0 0 15px rgba(255,0,0,0.5) inset;
}
}
@keyframes just2{
0%{
border: 5px solid rgba(0,255,0,0);
box-shadow: 0 0 0 rgba(0,255,0,0),0 0 0 rgba(0,255,0,0) inset;
}
100%{
border: 5px solid rgba(0,255,0,1);
box-shadow: 0 0 70px rgba(0,255,0,0.7),0 0 15px rgba(0,255,0,0.5) inset;
}
}
@keyframes just3{
0%{
border: 5px solid rgba(0,0,255,0);
box-shadow: 0 0 0 rgba(0,0,255,0),0 0 0 rgba(0,0,255,0) inset;
}
100%{
border: 5px solid rgba(0,0,255,1);
box-shadow: 0 0 70px rgba(0,0,255,0.7),0 0 15px rgba(0,0,255,0.5) inset;
}
}
Html部分
动态的毛玻璃背景
css部分
.app{
width: 100%;
height: 100vh;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.box{
width: 400px;
height: 300px;
position: relative;
}
.circle-box{
width: 100%;
height: 100%;
border-radius: 10px;
position: absolute;
overflow: hidden;
}
.circle:first-child{
width: 120px;
height: 120px;
border-radius: 50%;
border: 30px solid #7BF52A;
box-sizing: border-box;
position: absolute;
top: -38px;
left: -40px;
animation: move-y 3.5s linear infinite;
}
.circle:last-child{
width: 120px;
height: 120px;
border-radius: 50%;
background: linear-gradient(136deg, #7BF52A 0%, #FFCD56 100%);
box-sizing: border-box;
position: absolute;
bottom: -30px;
right: -30px;
animation: move-y 5s ease-in-out infinite;
}
.bg-filter{
width: 100%;
height: 100%;
background: rgba(255,255,255,.05);
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
backdrop-filter: blur(6px);
border-radius: 10px;
box-sizing: border-box;
position: absolute;
}
@keyframes move-y {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-16px);
}
100% {
transform: translateY(0);
}
}
图片因为上传后格式转换了,这篇就分享这几个,后面会再分享