css3制作模块变大的效果

<div class="iteye-blog-content-contain" style="font-size: 14px;">
<pre name="code" class="html"><!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>css3制作模块变大的效果</title>
</head>
<body>
<style type="text/css">
*{margin:0;padding:0px;}
body{background:#b1b1b1;font-family:Arial;font-size:125%;color:#202020;}
li{position:relative;list-style:none;float:left;width:235px;height:220px;margin:10px 0 0 10px;cursorointer;}
.tips{width:800px;margin:0 auto;line-height:24px;padding-top:10px;font-size:14px;}
.bredcolor{color:#fff;}
.module_change{width:980px;margin:0 auto;}
.module_change section{position:absolute;background:#ccc;padding:10px;text-align:center;
-webkit-animation:module_change .4s ease-in;
-webkit-animation-fill-mode:forwards;
}
li section:hover{background:red;-webkit-transition:background .3s linear;}
@-webkit-keyframes module_change{
0%{width:0px;height:0px;left:50%;top:50%;line-height:0px;opacity:0;}
100%{width:215px;height:200px;left:0%;top:0%;line-height:200px;opacity:1;}
}
</style>
<section class="tips">
本效果有多种方法实现:但是最简单的就是在外面套一层。原因:<br>
css3中大部分的效果是离不开position:absolute的。<br>
案例中的的效果需要变宽变高,并且是由中间扩散的。<br>
所以为了统一,我就在外面家了一个框,告诉他,这个是运动的标准。<br>
接下来就是运用什么属性了!变宽变位置肯定离不开keyframes,当然也可以运用transition。
<br><font color=black>▲ 目前IE8及以前版本不兼容CSS3,请使用IE9/火狐/Chrome浏览器运行本效果。<br><hr><
</section>
<section class="module_change">
<ul>
<li><section>1</section></li>
<li><section>2</section></li>
<li><section>3</section></li>
<li><section>4</section></li>
<li><section>5</section></li>
<li><section>6</section></li>
<li><section>7</section></li>
<li><section>8</section></li>
</ul>
</section>
</body>
</html></pre>
<p> </p>
</div>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值