0
晚安。CSS星級評分
大家好,我有一個問題:我的頁面中有一個單選按鈕星級分級小部件,此時星星彼此接近,我需要將它們分開(填充div的witdh)。
HTML
<div class="stars-div">
<div class="stars">
<input class="star-input star-5" id="star-5" type="radio" name="star"/>
<label class="star-icon star-5" for="star-5"></label>
<input class="star-input star-4" id="star-4" type="radio" name="star"/>
<label class="star-icon star-4" for="star-4"></label>
<input class="star-input star-3" id="star-3" type="radio" name="star"/>
<label class="star-icon star-3" for="star-3"></label>
<input class="star-input star-2" id="star-2" type="radio" name="star"/>
<label class="star-icon star-2" for="star-2"></label>
<input class="star-input star-1" id="star-1" type="radio" name="star"/>
<label class="star-icon star-1" for="star-1"></label>
</div>
</div>
CSS
.stars-div {
padding-top: 9.8%;
padding-left: 5%
}
.stars {
display: inline-block;
width: 100%
}
.star-input {
display: none;
}
.star-icon {
float: right;
padding: 10px;
font-size: 50px;
}
.star-input:checked ~ .star-icon:before {
content: '\f005';
color: #FD4;
}
.star-icon:hover:before, .star-icon:hover ~ .star-icon:before {
content: '\f005';
color: #ffea8e;
}
.star-icon:before {
content: '\f006';
font-family: FontAwesome;
}
注:當我嘗試使用引導程序圖標或使用任何div標籤周圍的輸入只有一個星將被填充。
我能做些什麼來解決這個問題?
非常感謝。
非常感謝你,它的工作。 PD:與填充的問題是,如果我使用這個例如