📜  使用引导图标纯 HTML 和 CSS 添加星级 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:19.451000             🧑  作者: Mango

代码示例1
CSS .rating { float:left; border:none; } .rating:not(:checked) > input { position:absolute; top:-9999px; clip:rect(0, 0, 0, 0); } .rating:not(:checked) > label { float:right; width:1em; padding:0 .1em; overflow:hidden; white-space:nowrap; cursor:pointer; font-size:200%; line-height:1.2; color:#ddd; } .rating:not(:checked) > label:before { content:'★ '; } .rating > input:checked ~ label { color: #f70; } .rating:not(:checked) > label:hover, .rating:not(:checked) > label:hover ~ label { color: gold; } .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 { color: #ea0; } .rating > label:active { position:relative; }