gpt4 book ai didi

javascript - 在这种情况下如何更改 css 内容悬停效果背景颜色 css php?

转载 作者:太空宇宙 更新时间:2023-11-04 12:09:37 25 4
gpt4 key购买 nike

查看代码并运行,我想更改内容'\00a0'背景颜色的悬停效果。改变背景色悬停效果没有问题,但不能改变内容'\00a0'的背景色--从灰色到绿色。帮助,欣赏。

.rating:not(:checked) > input {
position:absolute;
left:-9999px;
clip:rect(0,0,0,0);
}

.rating:not(:checked) > label {
float:right;
width:40px;
padding:0 .1em;
overflow:hidden;
white-space:nowrap;
cursor:pointer;
font-size:200%;
line-height:1.2;
color:#ddd;
text-shadow:1px 1px #bbb, 2px 2px #666, .1em .1em .2em rgba(0,0,0,.5);
}

.rating:not(:checked) > label:before {
content:'\00a0 \00a0 \00a0 ';
background-color: #c7c5c5;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
}

.rating > input:checked ~ label {
color: #f70;

text-shadow:1px 1px #c60, 2px 2px #940, .1em .1em .2em rgba(0,0,0,.5);
}

.rating:not(:checked) > label:hover,
.rating:not(:checked) :hover ~ label {
content:'\00a0 \00a0 \00a0 ';

background-color: #4bce32;/*here is what I want to change when user clikc*/
}

.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;
text-shadow:1px 1px goldenrod, 2px 2px #B57340, .1em .1em .2em rgba(0,0,0,.5);
}
<fieldset class="rating">
<legend>Please rate:</legend>
<input type="radio" id="star5" name="rating" value="5" /><label for="star5" title="Rocks!">5 stars</label>
<input type="radio" id="star4" name="rating" value="4" /><label for="star4" title="Pretty good">4 stars</label>
<input type="radio" id="star3" name="rating" value="3" /><label for="star3" title="Meh">3 stars</label>
<input type="radio" id="star2" name="rating" value="2" /><label for="star2" title="Kinda bad">2 stars</label>
<input type="radio" id="star1" name="rating" value="1" /><label for="star1" title="Sucks big time">1 star</label>
</fieldset>

最佳答案

改变

.rating:not(:checked) > label:hover,
.rating:not(:checked) :hover ~ label {
content:'\00a0 \00a0 \00a0 ';
background-color: #4bce32;/*here is what I want to change when user clikc*/
}

.rating:not(:checked) :hover ~ label:before {
content:'\00a0 \00a0 \00a0 ';
background-color: #4bce32;
}

.rating:not(:checked) :hover ~ label {
background-color: #4bce32;
}

关于javascript - 在这种情况下如何更改 css 内容悬停效果背景颜色 css php?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29134804/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com