页面图片光影掠过效果

很多页面中图片上会加上一道光影的效果,简单的效果如图:

页面图片光影掠过效果

<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <style type="text/css">
        .logo-site:before{
            content:"";
            position: absolute;
            left: -165px;
            top: -160px;
            width: 200px;
            height: 25px;
            background-color: rgba(255,255,255,.5);
            -webkit-transform: rotate(-45deg);
            -moz-transform: rotate(-45deg);
            -ms-transform: rotate(-45deg);
            -o-transform: rotate(-45deg);
            transform: rotate(-45deg);
            -webkit-animation: searchLights 1s ease-in 1s infinite;
            -o-animation: searchLights 1s ease-in 1s infinite;
            animation: searchLights 1s ease-in 1s infinite;
        }
        @-webkit-keyframes searchLights {
            0% { left: -100px; top: 0; }
            to { left: 120px; top: 100px; }
        }
        @-o-keyframes searchLights {
            0% { left: -100px; top: 0; }
            to { left: 120px; top: 100px; }
        }
        @-moz-keyframes searchLights {
            0% { left: -100px; top: 0; }
            to { left: 120px; top: 100px; }
        }
        @keyframes searchLights {
            0% { left: -100px; top: 0; }
            to { left: 120px; top: 100px; }
        }
    </style>
    <div class="logo-site" style="width:150px;height:50px;background:blue;"></div>
</body>
</html>

Tags: 笔记

添加新评论