Apply CSS for Razor control in Asp.Net MVC4 -
how apply width razor control @html.radiobuttonfor
in mvc4?
usermodel.cs
public string emp_gender{get; set;}
index.cshtml
@model mvcapplication.model.usermodel @using (html.beingform()) { @html.radiobuttonfor(m=>m.emp_gender,"male")male @html.radiobuttonfor(m=>m.emp_gender,"female")female }
razor:
@html.radiobuttonfor(m=>m.emp_gender,"male", new { @class = "male"})male @html.radiobuttonfor(m=>m.emp_gender,"female", new { @class = "female"})female
css:
input[type=radio].male { width: 150px; } input[type=radio].female { width: 300px; }
however, bear in mind browsers can bit finicky styling of radio buttons.
check link information possible:
http://www.456bereastreet.com/lab/styling-form-controls-revisited/radio-button/
(a bit outdated, still relevant)
Comments
Post a Comment