Zac Brown
Zac Brown

Reputation: 6063

HTML radiobutton color change

I think this is a pretty simple thing to do, but I don't know how.. thus I'm here. I have written a simple HTML form and need to change the color of the text on a Radio Button. Anyone have any ideas on how this is done?

Upvotes: 2

Views: 17065

Answers (2)

RPM1984
RPM1984

Reputation: 73112

Assuming the following HTML:

<input type="radio" name="group1" value="Milk" /><span>Milk</span>

Just either add a class to the span, or wrap it in a div and style that using basic CSS:

#somediv span
{
   color: red;
}

Upvotes: 3

Šime Vidas
Šime Vidas

Reputation: 185913

<input type="radio" id="foo">
<label for="foo"> Blah Blah </label>

Now you select the LABEL via CSS and set it to have a color... You can use classes or relationship, for example:

.radioDiv label { color:blue; }

Upvotes: 3

Related Questions