代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<style type="text/css">
div.xstips {
position: relative;
background: #FFFFFF;
display: inline-block;
text-decoration: none;
color: #222;
outline: none;
display: flex;
opacity:0;
animation-name : an-name;/*动画的名称*/
animation-duration : 5s;/*动画完成一个周期所花费的时间 5s*/
animation-timing-function : linear;/*动画的速度曲线 */
animation-delay : 1s;/*动画何时开始*/
animation-iteration-count : infinite;/*动画被播放的次数 无限循环 */
animation-direction: alternate;/*动画是否在下一周期逆向地播放*/
}
.xstips span {
position: absolute;
top:0;
z-index: 999;
border: 2px solid #F26C4F;
border-radius: 4px;
}
.xstips span:before,
.xstips span:after {
content: "";
position: absolute;
z-index: 1000;
bottom: -8px;
left: 50%;
margin-left: -8px;
border-top: 8px solid #F26C4F;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 0;
}
.xstips span:before{
border-top-color: #F26C4F;
bottom: -8px;
}
@keyframes an-name{
0%{opacity: 0;}
10%{opacity: .2;}
20%{opacity: .4;}
30%{opacity: .6;}
40%{opacity: .8;}
50%{opacity: 1;}
}
</style>
</head>
<body>
<div class="xstips"><span>嘿嘿,注意看这里的效果!</span></div>
</body>
</html>
