html页面上不断掉星星,html – 悬停在星星上时的星级评分css问题

当我徘徊在一些星星上时,我有一个奇怪的问题.明星效应应该正常工作,当用户徘徊第二颗星时,第一颗星也应该被填充,当用户在第三颗星上徘徊时,应该也填充前一颗星.

的jsfiddle:

HTML

CSS

.star-rating{

list-style:none;

margin: 0 auto;

padding:0px;

width: 250px;

height: 50px;

position: relative;

background: url(http://s11.postimg.org/cfr9p1xjz/alt_star.png) top left repeat-x;

}

.star-rating li{

padding:0px;

margin:0px;

float: left;

}

.star-rating li a{

display:block;

width:50px;

height: 50px;

text-decoration: none;

text-indent: -9000px;

z-index: 40;

padding: 0px;

}

.star-rating li a:hover{

background: url(http://s11.postimg.org/cfr9p1xjz/alt_star.png) left bottom;

z-index: 4;

left: 0px;

}

.star-rating a.one-star{

left: 0px;

}

.star-rating a.one-star:hover{

width:50px;

}

.star-rating a.two-stars{

left:50px;

}

.star-rating a.two-stars:hover{

width: 100px;

}

.star-rating a.three-stars{

left: 100px;

}

.star-rating a.three-stars:hover{

width: 150px;

}

.star-rating a.four-stars{

left: 150px;

}

.star-rating a.four-stars:hover{

width: 200px;

}

.star-rating a.five-stars{

left: 200px;

}

.star-rating a.five-stars:hover{

width: 250px;

}

.star-rating li.current-rating{

background: url(http://s11.postimg.org/cfr9p1xjz/alt_star.png) left center;

position: absolute;

height: 50px;

display: block;

text-indent: -9000px;

z-index: 1;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值