用div封装某些元素

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript" ></script>
<script type="text/javascript">
$(function(){
$(".topSaleList li").each(function(){
var o=$(this).find("a").eq(0).clone(true);
$(this).find("a").eq(0).remove();
var htm=$(this).html()
this.innerHTML="<div>"+htm+"</div>";
o.prependTo($(this));
})
})
</script>
<style type="text/css">
*{ margin:0px; padding:0px;}
body{ font:12px/1.5 Arial,sans-serif;}
ul,li{ list-style:none;}
img{ border:none;}
a{ text-decoration:none; color:#000;}
.topSaleList {
background: white;
border: 1px solid #CCC;
padding: 5px;
width: 178px;
}
.topSaleList ul li {
display: block;
border-bottom: 1px dashed #CCC;
padding: 5px;
line-height: 18px;
overflow: hidden;
}
.topSaleList ul li img{ width:66px; height:89px; float:left; display:block; margin-right:5px;}
.topSaleList ul li span{color: #E80000;}
</style>
</head>
<body>
<div class="topSaleList">
<ul>
<li>
<a href="#"><img src="http://images.coco.com.cn/uploads/product/2011/06/f500bdf0-95a1-4f75-b9be-4bf8cb74c4a9.jpg" /> </a>

<a href="#"> COCO 120D竖条纹提花分段 真人 黑色性感显瘦 段 真人 黑色性感显瘦</a>
<br>
售价:
<span class="red_cu">¥268.0</span>
<br>
月销量:
<span class="red_cu">39</span>件
</li>

<li>
<a href="#"><img src="http://images.coco.com.cn/uploads/product/2011/06/eadb2eab-0104-42cc-aa60-691f24271b2d.jpg" /></a>
<a href="#">coco正品夏季女性感可爱蕾丝 </a>
<br>
售价:
<span class="red_cu">¥168.0</span>
<br>
月销量:
<span class="red_cu">27</span>件
</li>

<li>
<a href="#"><img src="http://images.coco.com.cn/uploads/product/2011/06/b4e77c7d-b3c9-4a2c-92f2-d089dc2c8a6b.jpg" /> </a>
<a href="#"> coco新品 华丽镶钻文胸聚拢 </a>
<br>
售价:
<span class="red_cu">¥159.0</span>
<br>
月销量:
<span class="red_cu">25</span>件
</li>

</ul>
</div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值