bài viết này mình giới thiệu về đoạn code CSS3 thay đổi hình ảnh khá đẹp mắt khi rê chuột vào.
Demo: http://360anhdep.blogspot.com/p/a.html
Code:
<style type="text/css">
a.nowandthen{
position:relative;
display: block;
overflow:hidden;
cursor: pointer;
width: 650px;
height: 434px;
}
a.nowandthen img{
position:absolute;
left:0;
top:0;
width: 100%;
height: 100%;
-moz-transition: all 0.4s ease;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
-ms-transition: all 0.4s ease;
transition: all 0.4s ease;
z-index: 2;
clip: rect(0,650px,434px,0);
}
a.nowandthen img:nth-of-type(2){
z-index: 1;
}
a.nowandthen:hover img:nth-of-type(1){
clip: rect(0,0,434px,0);
opacity: 0;
}
</style>
<a class="nowandthen" href="http://itviet360.com">
<img alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyxX55yA73A0UIU2yGNsA4EffKpNLNIsYQRRNwzhKKwybsHlykHschfh8W9MuUfClYE8wk3Tql7EErk0I9IXf2PebrRhqtcfNWnuPX2p8SfRBom8zSOIj1QUBQqc89dBKcnlojkLHLH6I/s1600/sunset-sunrise-btrix+(1).jpg" />
<img alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2PJg97UXrMB5Pz7yHX6zpB2zbUKZwbIBUh1pCXkQZnegAj9NgCROQTREExqCVHHBGBd9p4fT9PTJowjFO7RgL6EBX3fDvgJ2pdElL9AycYe4R784VMEWWCHtl1urDmNOpVO3ZVC6zJEU/s1600/sunset-sunrise-btrix+(2).jpg" />
</a>- Dán code đó vào vị trí các bạn cần thêm nhé/














Đặt làm trang chủ
Giới thiệu
E-mail: vihovfu@gmail.com
Liên hệ Quảng cáo
Tuyển cộng tác viên
Đường dây nóng 01644416591
Top