因此,我有一个单选按钮,文本“是”和“否”,我希望字体颜色改变,如果任何一个被选中。
- 是(绿色)
- 否(红色)
下面是html格式的代码
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="No" Value="False" />
<asp:ListItem Text="Yes" Value="True" />
</asp:RadioButtonList>
我在css中有下面的代码,它改变了选中的单选按钮的标签input[type="radio"]:checked + label { font-weight: bolder !important; }
1条答案
按热度按时间x9ybnkn61#
您可以使用方括号定位任何属性,包括“Text”属性:
第一个