?????.rating{
????????position:relative;
????????width:240px;
????????height:45px;????????
????????margin:250px?auto;
????????background:url(images/icon.png)?repeat-x;
?????}
?????.rating-item{
????????position:absolute;??
????????top:0;
????????z-index:?3;
????????width:48px;
????????height:45px;
?????}
?????.rating-item-1{
????????left:0px;
?????}
?????.rating-item-2{
????????left:48px;
?????}
?????.rating-item-3{
????????left:96px;
?????}
?????.rating-item-4{
????????left:144px;
?????}
?????.rating-item-5{
????????left:192px;
?????}
?????.rating-item-1:hover,#rating-1:checked?+?.rating-item{
?????????width:48px;
?????}
?????.rating-item-2:hover,#rating-2:checked?+?.rating-item{
?????????width:96px;
?????}
?????.rating-item-3:hover,#rating-3:checked?+?.rating-item{
?????????width:144px;
?????}
?????.rating-item-4:hover,#rating-4:checked?+?.rating-item{
?????????width:192px;
?????}
?????.rating-item-5:hover,#rating-5:checked?+?.rating-item{
????????width:240px;
?????}
?????.rating-item?label{
????????display:inline-block;
????????width:100%;
????????height:100%;
????????cursor:?pointer;
?????}??
?????.rating?input:checked?+?.rating-item{
????????left:0;
????????background:url(images/icon.png)?repeat-x?0?-45px;
????????z-index:1;
?????}
??.rating-item:hover{
????????left:0;
????????z-index:?2;
????????background:url(images/icon.png)?repeat-x?0?-45px?;
?????}
?????.rating:hover?.rating-item{
????????background-image:none;
?????}
???????.rating-item:hover{
???????
????????background:url(images/icon.png)?repeat-x?0?-45px?!important;}
????????
????.rating?input:checked?+?.rating-item?~?.rating-item:hover{
????????z-index:?0;
?????}
2018-04-13
因為第二個rating-hover上面有background-image為none,且權(quán)重比較高,所以第二個會加上!important提高權(quán)限避免被none掉。所以我覺得是不是第一個hover的background可以去掉。。
2018-06-04
兩次的.rating-item:hover完全可以合并到一塊,不會有啥毛病