模仿淘宝评价的星级显示
2015-11-26 16:51
351 查看
HTML代码部分:
<!DOCTYPE html>
<html>
<head>
<title>stars_show</title>
<meta http-equiv="content-type" content="text/html" charset="utf-8"/>
</head>
<body>
<div class="shop_item_star">
<div class="star4"></div>
<div class="shop_star"></div>
</div>
</body>
</html>
CSS代码部分:
@charset "utf-8";
/****************************************** star ********************************************************/
.shop_item_star .shop_star, .shop_item_star .star1, .shop_item_star .star2, .shop_item_star .star3, .shop_item_star .star4, .shop_item_star .star5 {
background: url("stars_icons.png") no-repeat scroll -72px -22px #fff;
height: 20px;
position: absolute;
width: 100px;
z-index: 10;
}
.shop_item_star .shop_star {
background-position: -72px 0;
position: static;
z-index: 1;
}
.shop_item_star .star1 {
width: 18px;
}
.shop_item_star .star2 {
width: 36px;
}
.shop_item_star .star3 {
width: 54px;
}
.shop_item_star .star4 {
width: 72px;
}
.shop_item_star .star5 {
width: 90px;
}
图片:
<!DOCTYPE html>
<html>
<head>
<title>stars_show</title>
<meta http-equiv="content-type" content="text/html" charset="utf-8"/>
</head>
<body>
<div class="shop_item_star">
<div class="star4"></div>
<div class="shop_star"></div>
</div>
</body>
</html>
CSS代码部分:
@charset "utf-8";
/****************************************** star ********************************************************/
.shop_item_star .shop_star, .shop_item_star .star1, .shop_item_star .star2, .shop_item_star .star3, .shop_item_star .star4, .shop_item_star .star5 {
background: url("stars_icons.png") no-repeat scroll -72px -22px #fff;
height: 20px;
position: absolute;
width: 100px;
z-index: 10;
}
.shop_item_star .shop_star {
background-position: -72px 0;
position: static;
z-index: 1;
}
.shop_item_star .star1 {
width: 18px;
}
.shop_item_star .star2 {
width: 36px;
}
.shop_item_star .star3 {
width: 54px;
}
.shop_item_star .star4 {
width: 72px;
}
.shop_item_star .star5 {
width: 90px;
}
图片:
相关文章推荐
- 漫谈程序员(八)阿里巴巴集团合伙人花名单
- pure-ftpd 虚拟用户连接报错Sorry, invalid address given
- spring 配置事务传播特性
- 解决安全扫描HTTP的不安全方法
- 读《50 Android Hacks》笔记整理Hack 1~Hack 8
- libsvm Minist Hog 手写体识别
- 自以为是的多线程(一)
- Android中shape的使用
- 写点总结
- [SQLServer] 50种方法优化SQL Server数据库查询
- .bat set java environment
- iOS 解决UITabBarItem选中图片默认为蓝色的方法
- srm 556
- 一个快速打开微信收藏的方法
- EEPROM分页写数据的理解
- 各种图形状图
- poj 1353 Color Change of Go Game Pieces 模拟
- 统计语言模型学习笔记
- 【读书笔记一】Zen and the Art of Objective_C Craftsmanship
- normalize.css