css - Bootstrap 列宽调整

标签 css razor bootstrap-4

我刚开始使用 Bootstrap。我尝试调整 3 列的行以适应,最后一列分为另外 3 列,但它重叠并且很难使其看起来正确。

see Picture

第一行的我的 cshtml:

 <div class="row">
        <div class="col-md-4 col-sm-4">
            <strong>Last Name</strong> <span class="required">*</span>
            @Html.TextBoxFor(m => m.Patient_Lastname, new { @class = "text-primary", required = "required" })
        </div>
        <div class="col-md-4 col-sm-4">
            <strong>First Name</strong> <span class="required">*</span>
            @Html.TextBoxFor(m => m.Patient_Firstname, new { @class = "text-primary", required = "required" })
        </div>
       <div class="col-md-1 col-sm-1">
            <strong>birth</strong> <span class="required">*</span>
            @Html.DropDownListFor(m => m.YearOfBirth, Enumerable.Range(1900, 119).Select(i => new SelectListItem { Value = i.ToString(), Text = i.ToString() }),
           "--Year--", new { @class = "form-control", style = "width: 90px; height:30px;", required = "required" })
        </div> 
        <div class="col-md-1 col-sm-1">
            <strong>Month</strong> <span class="required">*</span>
            @Html.DropDownListFor(m => m.YearOfBirth, Enumerable.Range(1, 12).Select(i => new SelectListItem { Value = i.ToString(), Text = i.ToString() }),
           "--Month--", new { @class = "form-control", style = "width: 90px; height:30px;", required = "required" })
        </div> 
        <div class="col-md-2 col-sm-2">
            <strong>Day</strong> <span class="required">*</span>
            @Html.DropDownListFor(m => m.YearOfBirth, Enumerable.Range(1, 31).Select(i => new SelectListItem { Value = i.ToString(), Text = i.ToString() }),
           "--Day--", new { @class = "form-control", style = "width: 80px; height:30px;", required = "required" })
        </div> 
    </div>

第二行和第三行直接用 col-md-4

你能帮我解决这个问题吗?

TIA 罗恩。

最佳答案

我认为问题在于输入的填充宽度大于可用宽度,请尝试调整它的大小。

关于css - Bootstrap 列宽调整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56385829/

相关文章:

html - 中间带有 Logo 的导航栏

php - 如何使用引导行类为卡片创建 3 列

html - Bootstrap 无法与 visual studio 2017 一起正常工作

javascript - 为什么容器 div 高度没有更新?

html - 帧的高度(以像素为单位)

asp.net - 如何用 mvc4 actionlink 列表替换列表

c# - 在 VS2015 中使用 ASP.NET MVC Razor 时无法识别大括号

css - 在 SASS/SCSS 中过度嵌套选择器在实践中有多糟糕?

html - 可滚动元素内的绝对定位

jquery - ASP.NET MVC3 Razor 与 Html.Helpers 和 JQuery 模板的串联