CSS3情人节特效在这个情人节来临的时刻,你是否想要为你的网站增添一些浪漫和热情的气息?如果是的话,那就来试试使用CSS3情人节特效吧!以下是几个简单的CSS3代码段,能够为你的网站增添浪漫气息:1....
CSS3情人节特效
在这个情人节来临的时刻,你是否想要为你的网站增添一些浪漫和热情的气息?如果是的话,那就来试试使用CSS3情人节特效吧!以下是几个简单的CSS3代码段,能够为你的网站增添浪漫气息:
1. 心形背景
body {
background: linear-gradient(45deg, #f73e44, #f97f51, #fc9e5b, #fdea8f);
background-size: 300% 300%;
animation: gradient 15s ease infinite;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.heart {
height: 100px;
position: relative;
width: 100px;
}
.heart:before,
.heart:after {
background-color: #fc3158;
border-radius: 50px 50px 0 0;
content: "";
height: 50px;
left: 50px;
position: absolute;
top: 0;
transform: rotate(-45deg);
transform-origin: 0 100%;
width: 50px;
}
.heart:after {
left: 0;
transform: rotate(45deg);
transform-origin: 100% 100%;
} 2. 动态文字
.title:after {
animation: pulse 1.5s ease infinite;
border-radius: 10px;
content: "I Love You.";
display: inline-block;
font-family: "Courier New", Courier, monospace;
font-size: 100px;
padding: 0 20px;
position: relative;
}
@keyframes pulse {
0% {
transform: scale(1);
}
25% {
transform: scale(1.1);
}
50% {
transform: scale(0.9);
}
75% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
} 3. ***动画
.bomb {
position: relative;
width: 100px;
height: 100px;
margin: 50px auto;
}
.bomb:before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: 60px;
height: 60px;
border: 10px solid #F7464A;
border-radius: 50%;
animation: explode 2s ease;
animation-fill-mode: forwards;
}
@keyframes explode {
0% {
transform: scale(0.5);
}
100% {
transform: scale(1.5);
opacity: 0;
}
} 试试使用上述CSS3代码段,让你的网站充满浪漫之情吧!