代码之家  ›  专栏  ›  技术社区  ›  DoomerDGR8

剑道:启用浮动标签的全宽

  •  0
  • DoomerDGR8  · 技术社区  · 6 年前

    我开始使用新的浮动标签,但我注意到,控件(否则为全宽)现在已调整为默认大小。这是我的代码:

    <div class="form-group">
        <div class="col-sm-4">
            @(Html.Kendo().TextBoxFor(m => m.ContactPersonName)
                  .HtmlAttributes(new { @class = "form-control", style = "width: 100%;" })
                  .Label(l => l.Content("Name *").Floating(true)))
        </div>
        <div class="col-sm-4">
            @(Html.Kendo().TextBoxFor(m => m.Mobile)
                  .HtmlAttributes(new { @class = "form-control numeric phone", style = "width: 100%;" })
                  .Label(l => l.Content("Mobile # *").Floating(true)))
        </div>
        <div class="col-sm-4">
            @(Html.Kendo().TextBoxFor(m => m.Email)
                  .HtmlAttributes(new { @class = "form-control", style = "width: 100%;" })
                  .Label(l => l.Content("Email *").Floating(true)))
        </div>
    </div>
    
    <div class="form-group">
        <div class="col-sm-8">
            @(Html.Kendo().TextBoxFor(m => m.TRN)
                  .HtmlAttributes(new { @class = "form-control", maxlength = "15", style = "width: 100%;" })
                  .Label(l => l.Content("Tax Registration # *").Floating(true)))
        </div>
    </div>
    
    <div class="form-group">
        <div class="col-sm-8">
            @(Html.Kendo().TextBoxFor(m => m.SponsorName)
                  .HtmlAttributes(new { @class = "form-control", maxlength = "100", style = "width: 100%;" })
                  .Label(l => l.Content("Sponsor Name *").Floating(true)))
        </div>
        <div class="col-sm-4">
            @(Html.Kendo().TextBoxFor(m => m.TradeLicenseNo)
                  .HtmlAttributes(new { @class = "form-control numeric", maxlength = "20", style = "width: 100%;" })
                  .Label(l => l.Content("Trade License # *").Floating(true)))
        </div>
    </div>
    

    看起来,浮动标签为HTML和 width: 100% 风格没有相应地形成。

    Not 100 % styling

    以下是生成的标记: Generated HTML

    我如何设计这个表单以占据引导单元格的宽度。

    0 回复  |  直到 6 年前
        1
  •  0
  •   DoomerDGR8    6 年前

    我在Edge的控制台中创建了一种新的样式:

    span.k-floating-label-container {
      width: 100%;
    }