

最终效果如下所示:

全部代码如下:
<!DOCTYPE html>
<html>
<head>
<style>
p{
width:50%;
margin:0 auto;
line-height:50px;
font-size:50px;
text-align:center;
-webkit-background-clip: text; /*按文字裁剪*/
-webkit-text-fill-color: transparent; /*文字的颜色使用背景色*/
background-color:#19385c; /*设置一个背景色*/
background-image: -webkit-linear-gradient(-45deg, rgba(0, 0, 0, 0.6) 30%, #aff0ff 50%, rgba(0, 0, 0, 0.6) 70%); /*设置渐变的背景,按对角线渐变*/
background-blend-mode: hard-light; /*设置背景为混合模式下的强光模式*/
background-size: 200%;
-webkit-animation: shine 4s infinite; /*给背景添加动画改变位置*/
}
@-webkit-keyframes shine {
from {background-position: 100%;}
to {background-position: 0;}
}
</style>
</head>
<body><p>> Slide To Unlock</p></body>
</html>需要说明的是由于按文字裁剪目前只有 webkit 内核可用,所以该效果目前不兼容其他内核浏览器。
以上所述是小编给大家介绍的CSS3实现iPhone滑动解锁功能代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
更多CSS3实现iPhone滑动解锁功能代码示例相关文章请关注PHP中文网!
