How to use CSS to change font color in HTML based on tag text content
P粉349222772
P粉349222772 2023-09-08 20:57:35
0
1
414

So I have a radio button with the text "Yes" and "No" and if any of them is selected I want the font color to change.

  • Yes (green)
  • No (red)

The following is the html code:

<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
  <asp:ListItem Text="否" Value="False" />
  <asp:ListItem Text="是" Value="True" />
</asp:RadioButtonList>

I have the following code in css that changes the label of the selected radio button:

input[type="radio"]:checked label { Font weight: bold! important; }

P粉349222772
P粉349222772

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!