开发者

HTML radiobutton color change

开发者 https://www.devze.com 2023-01-18 07:33 出处:网络
I think this is a pretty simple thing to do, but I don\'t know h开发者_开发问答ow.. 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

I think this is a pretty simple thing to do, but I don't know h开发者_开发问答ow.. 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?


<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; }


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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号