我正在尝试更改单选按钮颜色,同时保持我的绑定。请问我该怎么做?
我尝试了两种方法,将css内联设置为样式表。两者都没有效果。
<div class="col-sm-6">
<div class="form-group">
<div >
<label>@Html.RadioButtonFor(m => m.SelectedGroup, "Red", htmlAttributes: new { @class = "btn-red" }) Number of spots available @Model.Red</label>
</div>
</div>
<div class="form-group">
<div >
<label>@Html.RadioButtonFor(m => m.SelectedGroup, "Yellow", new { @style = "color:Yellow;" }) Number of spots available @Model.Yellow</label>
</div>
</div>
<div class="form-group">
<div >
<label>@Html.RadioButtonFor( m => m.SelectedGroup, "Green", new { @style = "color:Green;" }) Number of spots available @Model.Green</label>
</div>
</div>
</div>
https://codepen.io/anon/pen/vddyax
我试图让它看起来像这样