0

I'm using purecss.io on a project of mine and I am having an issue when trying to apply a label style to a LabelFor element. I know it does not take any html attributes but I cannot get it to take the style when wrapped without squashing all of the letters together.

LabelFor squished

I've tried the following lines and have stopped just short of editing the template, but will if there is not an easier way.

<label>@Html.LabelFor(model => model.keyId)</label>
<div class="pure-form label">@Html.LabelFor(model => model.keyId)</div>

EDIT: Yes sorry it is wrapped in pures "pure-form-aligned".

    <div class="pure-form pure-form-aligned">

    <fieldset>

        <div class="pure-control-group">
            <div class="pure-form ">@Html.LabelFor(model => model.keyId)</div>
Paolo Moretti
  • 54,162
  • 23
  • 101
  • 92
Syrsyrian
  • 35
  • 1
  • 5

2 Answers2

1

What makes you think LabelFor cannot accept HTML attributes? It definitely can:

@Html.LabelFor(m => m.Foo, new { @class = "myclass" })
Chris Pratt
  • 232,153
  • 36
  • 385
  • 444
  • I had been reading old information. Before MVC 4 it did not accept html attributes. Thanks for the heads up anyways. – Syrsyrian Sep 22 '14 at 15:04
0

It seems the issue was was with grid nesting. The partial was nested in a view and I had ended up with three sets of nested grids (including the grid in the layout view). Removing the grids from the partial fixed it.

Syrsyrian
  • 35
  • 1
  • 5