实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes"> <title>祈福供香,孩子平安吉祥!</title> <style type="text/css"> *{ margin:0;padding: 0; font-weight: normal;} a{ text-decoration: none; } body{ font-size:14px;font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;} header{height: 250px; overflow: hidden; } .top{ background:#d75847; height: 70px;border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; text-align: center;} .top span{ width: 80px; margin:0 auto; display: block; } .top span img{ width: 100%;height: 100%; border-radius: 50%; margin-top:40px; } .top h2{color: #393939; margin: 30px 0 10px 0px;} .top p{ color: #808080 } .content{ width: 90%; margin: 0 auto; overflow: hidden; text-align: center;padding-top: 10px; border-top:1px solid #f5f5f5;} /*.content ul li { float: left; display: block; width:25%;padding:7% 0; border:2px solid #d75644;margin-left:6%;margin-bottom: 5%; color: #d75644; border-radius: 5px; overflow: hidden;}*/ .content ul li:hover{ background: #d75644; cursor: pointer; color: #fff;} /*.content ul li:nth-child(3) ~ *{ margin-bottom: 0;}*/ .content ul li em{ font-size: 25px; padding:0 10px; } .other{ text-align: center; padding:20px 0 0 0;} footer{ text-align: center; margin:10% 0 0 0; } footer p {margin-top:10px;color: #cdcdcd;} </style> </head> <body> <header> <div class="top"> <span><img src="http://43d.cc/front/0401/images/fozu.jpg"></span> <h2>随喜支持</h2> <p>祈福供香,孩子平安吉祥!</p> </div> </header> <div class="content"> <ul id="test"> <li><em>8</em></li> <li><em>66</em></li> <li><em>88</em></li> <li><em>168</em></li> <li><em>518</em></li> <li><em>888</em></li> <li><em><img src="http://43d.cc/front/0330/images/3.jpg"></em></li> <li><img src="http://43d.cc/front/0330/images/4.jpg"></li> <img src="http://43d.cc/front/0330/images/1.jpg"> </ul> </div> <div class="other">其他金额</div> <footer> <p>赞赏是为了表示鼓励对平台的无偿赠与</p> </footer> </body> </html> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <script type="text/javascript"> $('li').get(1).style.background = 'lightyellow' //索引 $('li').eq(4).css('color','red') //索引 $('li').first().css('border-color','#666') $('li').last().css('border','none') $('ul').find('img').css('width','200') var li = $('li').toArray() for(var i=0;i<li.length-2;i++){ li[i].style.float = 'left' } $('li').each(function(){ $(this).css('display','block') $(this).css('width','25%') $(this).css('height','20%') $(this).css('padding','7% 0') $(this).css('border','2px solid #d75644') $(this).css('margin-left','6%') $(this).css('margin-bottom','5%') $(this).css('border-radius','5px') $(this).css('color','#d75644') $(this).css('overflow','hidden') }) $('img').filter(':last()').css('width','100%') </script>
运行实例 »
点击 "运行实例" 按钮查看在线实例