css - Radio Input with hover -



css - Radio Input with hover -

i trying add together hover radio boxes. !important not work. there way radio input fields hovering? can see total illustration on jsfiddle. tried on line 39.

if select 5th radio box, , hover on first one, other should turn gray , hovered orange.

/* filled rating */ .rating-fill{ width:0; height:100%; background:url('data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wiiblbmnvzgluzz0idxrmltgipz4ncjwhls0gr2vuzxjhdg9yoibbzg9izsbjbgx1c3ryyxrvciaxny4xljasifnwrybfehbvcnqgugx1zy1jbiauifnwrybwzxjzaw9uoia2ljawiej1awxkidapicatlt4ncjwhre9dvflqrsbzdmcgufvcteldicitly9xm0mvl0rurcbtvkcgms4xly9ftiigimh0dha6ly93d3cudzmub3jnl0dyyxboawnzl1nwry8xljevrfrel3n2zzexlmr0zci+dqo8c3znihzlcnnpb249ijeumsigawq9ikvizw5lxzeiihhtbg5zpsjodhrwoi8vd3d3lnczlm9yzy8ymdawl3n2zyigeg1sbnm6egxpbms9imh0dha6ly93d3cudzmub3jnlze5otkvegxpbmsiihg9ijbweciget0imhb4ig0kcsb2awv3qm94psiwidagmjagmjaiigvuywjszs1iywnrz3jvdw5kpsjuzxcgmcawidiwidiwiib4bww6c3bhy2u9inbyzxnlcnzlij4ncjxwb2x5z29uigzpbgw9iingoei0mdaiihbvaw50cz0imtasmcaxmy4xldyuniaymcw3ljygmtusmtiuocaxni4yldiwidewlde2ljygmy44ldiwidusmtiuocawldcunia2ljksni42icivpg0kpc9zdmc+dqo='); position:absolute; background-size: contain; top:0; left:0; z-index:1; } /* checked inputs */ .radio-wrap input[value="5"]:checked + .rating-fill{ width:100%; } .radio-wrap input[value="4"]:checked + .rating-fill{ width:80%; } .radio-wrap input[value="3"]:checked + .rating-fill{ width:60%; } .radio-wrap input[value="2"]:checked + .rating-fill{ width:40%; } .radio-wrap input[value="1"]:checked + .rating-fill{ width:20%; } /* blank stars */ .rating-blank{ width:100%; height:100%; background:url('data:image/svg+xml;base64,phn2zyb2zxjzaw9upsixljeiihhtbg5zpsjodhrwoi8vd3d3lnczlm9yzy8ymdawl3n2zyigeg1sbnm6egxpbms9imh0dha6ly93d3cudzmub3jnlze5otkvegxpbmsiihg9ijbweciget0imhb4iib3awr0ad0imjbwecigagvpz2h0psiymhb4iib2awv3qm94psiwidagmjagmjaiigvuywjszs1iywnrz3jvdw5kpsjuzxcgmcawidiwidiwiib4bww6c3bhy2u9inbyzxnlcnzlij48cg9sewdvbibmawxspsijrererereiibwb2ludhm9ijewldagmtmumdksni41odmgmjasny42mzkgmtusmtiunzy0ide2lje4ldiwidewlde2lju4myazljgyldiwidusmtiunzy0idasny42mzkgni45msw2lju4myailz48l3n2zz4='); position:absolute; background-size: contain; top:0; left:0; z-index:0; }

http://jsfiddle.net/9q9gfob6/2/

your code working. because first star selected(width 20% initially), hover isn't taking effect.

.radio-wrap input[value="5"]:hover + .rating-fill{ width:100%; } .radio-wrap input[value="4"]:hover + .rating-fill{ width:80%; } .radio-wrap input[value="3"]:hover + .rating-fill{ width:60%; } .radio-wrap input[value="2"]:hover + .rating-fill{ width:40%; } .radio-wrap input[value="1"]:hover + .rating-fill{ width:20%; }

fiddle 5th input dropped hovering on 5th star doesn't create effect.

css radio-button

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -