CSS special effects a flash in the picture across the code

Source: Internet
Author: User

In Baidu music http://music.baidu.com/see such a picture effect, when the mouse moved up, there will be a flash in the picture across, the effect is very cool. So the effect can be realized again:
The general idea is that the design of a transparent layer of i,skewx on the x-axis of the negative 25 degrees of deformation, the background color with the CSS3 linear gradient linear-gradient, and then hover, set 0.5s animation time.
At the same time in the I layer using cursor:pointer, if not set this, need to wait for transparent layer animation before you can see the pointer pointer.
Open FireBUG debugging to see more clearly!



The
code is as follows:


<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">


<html xmlns= "http://www.w3.org/1999/xhtml" >


<head>


<meta http-equiv= "Content-type" content= "text/html"; Charset=utf-8 "/>


<title> Flash Pictures </title>


<style>


. overimg{


position:relative;


Display:block;


/* Overflow:hidden; */


box-shadow:0 0 10px #FFF;


}


. light{


Cursor:pointer;


Position:absolute;


left: -180px;


top:0;


width:180px;


height:90px;


background-image:-moz-linear-gradient (0deg,rgba (255,255,255,0), Rgba (255,255,255,0.5), Rgba (255,255,255,0));


background-image:-webkit-linear-gradient (0deg,rgba (255,255,255,0), Rgba (255,255,255,0.5), Rgba (255,255,255,0 ));


transform:skewx ( -25DEG);


-o-transform:skewx ( -25DEG);


-moz-transform:skewx ( -25DEG);


-webkit-transform:skewx ( -25DEG);


}


. Overimg:hover. light{


left:180px;


-moz-transition:0.5s;


-o-transition:0.5s;


-webkit-transition:0.5s;


transition:0.5s;


}


</style>


</head>


<body>


<p class= "overimg" >


<a><img src= "2014_02_15_01.jpg" ></a>


<i class= "Light" ></i>


</p>


</body>


</html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.