1
I want to use two CSS classes in Razor. Is it possible to do this? Because I’m not getting it.
Here’s what I’m doing:
<div class="form-group">
@Html.LabelFor(model => model.ativo, htmlAttributes: new { @class = "control-label col-md-2", @id = "ativo" })
<div class="col-md-10">
@Html.CheckBoxFor(model => model.ativo, new { htmlAttributes = new { @class = "form-control flat" } })
@Html.ValidationMessageFor(model => model.ativo, "", new { @class = "text-danger" })
</div>
</div>
But the stylization of the "flat" class does not work. Does anyone have any solution?
Are you sure the class isn’t being applied? Because that’s the way it’s done, if memory serves.
– Jéf Bueno
The way to assign the CSS classes in the component is correct, could post the class declaration
flat
kindly?– Elexsandro Rangel dos Santos
Lucas, you can’t forget to reference your style file. Something like
<link href="~/Content/font-awesome.min.css" rel="stylesheet" />
– Pablo Tondolo de Vargas