HTML实现图片的定向移动

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.l1{  overflow:hidden; }
.l1>ul{ list-style:none;}
.l1>ul>li{ overflow:hidden;width:300px; height:371px; float:left; }
.l1 img{transition:0.5s;}
.l1 img:hover{ margin-left:-10px;}
</style>
</head>


<body>
<div class="l1">
    <ul>
            <li>
                    <img src="images/test.jpg" alt="" width="650" height="371" />
                    </li>
             </ul>
   
    </div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/Boomoon/article/details/54019968