其次设置div的样式为怎么浮动即可。上面只要定义aa的css样式float的值就可以了
<!doctype html><html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<style>
ul,li{list-style:nonemargin:0padding:0}
li{width:287pxheight:287pxposition:relative}
li a{display:blockwidth:100%height:100% position:absolutetop:0left:0}
li a:hover{background:#f00}
.box{width:0height:287px position:absoluteleft:0top:0background:#f00 overflow:hidden}
li:hover .box{width:287pxheight:287px-webkit-transition:all .3s ease-in-moz-transition:all .3s ease-in-ms-transition:all .3s ease-in-o-transition:all .3s ease-intransition:all .3s ease-in}
</style>
<ul>
<li><img src="http://img0.bdstatic.com/img/image/shouye/lyj/huzi.jpg"><div class="box"><span>哈哈哈哈哈哈哈</span></div></li>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)