網站logo掃光效果CSS實現

例如:

<div class="logo">
<a  href="#" rel="home" itemprop="url">
<img src="圖片地址" alt="logo" itemprop="logo" width="150" height="50">
</a>
</div>

CSS樣式:

/**logo掃光效果CSS**/
#logo:before{  /**根據logo外div樣式名稱修改before前名稱**/
    content:"";
    position: absolute;
    left: -665px; /**第一個數字參數控制掃光速度,數字越大越慢**/
    top: -460px;
    width: 200px;
    height: 10px; /**光標的寬度,可根據實際調整**/
    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 1.5s 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; }
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章