html - Rating star not working -


hi have rating star using html , css.i try use :checked in css code rating star can't hold rating value.so how can keep rating value.any suggestion this.thanks support

here html

<div class="rate-container">   <i class="fa fa-star "></i>   <i class="fa fa-star "></i>   <i class="fa fa-star "></i>   <i class="fa fa-star "></i>   <i class="fa fa-star "></i> </div> 

css

.rate-container > {         float: right;     }      .rate-container > i:hover,     .rate-container > i:hover ~ {         color: gold;     } 

you can definetly pure html/css. made own site while back. code suffice going.

the biggest change you'll have change content property \f005; font-family: fontawesome property, since used icons instead of font. rest should more or less identical.

good luck!

.rating {     display: inline-block; }  .rating:not(:checked) > input {     display:none; }  .rating:not(:checked) > label {     float: right;     width: 28px;     padding: 0 4px;     overflow: hidden;     white-space: nowrap;     cursor: pointer;     font-size: 200%;     line-height: 1.2;     color: #ddd;     filter: saturate(0);     -webkit-filter: saturate(0);     -moz-filter: saturate(0);     -o-filter: saturate(0);  }  .rating:not(:checked) > label:before {     content: url("http://i.imgur.com/1dt6fai.png") ' '; }  .rating > input:checked ~ label {     filter: saturate(1);     -webkit-filter: saturate(1);     -moz-filter: saturate(1);     -o-filter: saturate(1); }  .rating:not(:checked) > label:hover, .rating:not(:checked) > label:hover ~ label {     filter: hue-rotate(-50deg);     -webkit-filter: hue-rotate(-50deg);     -moz-filter: hue-rotate(-50deg);     -o-filter:hue-rotate(-50deg);  }  .rating > input:checked + label:hover, .rating > input:checked + label:hover ~ label, .rating > input:checked ~ label:hover, .rating > input:checked ~ label:hover ~ label, .rating > label:hover ~ input:checked ~ label {     filter: hue-rotate(-50deg);     -webkit-filter: hue-rotate(-50deg);     -moz-filter: hue-rotate(-50deg);     -o-filter:hue-rotate(-50deg);  } 

demo

i should note code inspired other source on net. unfortunately don't have link it.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -