gpt4 book ai didi

html - 如何摆脱输入和日历图标之间的空间

转载 作者:太空宇宙 更新时间:2023-11-04 03:18:59 25 4
gpt4 key购买 nike

更新:

enter image description here

在执行此代码后,我得到了:

<div class="col-xs-5">
<div class="form-group">
<label for="" class="col-xs-5 control-label">Contract Date Signed:</label>
<div class="col-xs-5">
@Html.EditorFor(m => m.ContractDateSigned, new { htmlAttributes = new { @Value = Convert.ToDateTime(Model.ContractDateSigned).ToShortDateString(), @class = "form-control" } })
@Html.ValidationMessageFor(m => m.ContractDateSigned, "", new { @class = "text-danger"
})
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span></span>
</div>
</div>
</div>

如何去掉输入框和日历图标之间的空格?

enter image description here

这是我使用的 html:

<div class="col-xs-5">
<div class="form-group">
<label for="" class="col-xs-5 control-label">Contract Date Signed:</label>
<div class="col-xs-5">
@Html.EditorFor(m => m.ContractDateSigned, new { htmlAttributes = new { @Value = Convert.ToDateTime(Model.ContractDateSigned).ToShortDateString(), @class = "form-control" } })
@Html.ValidationMessageFor(m => m.ContractDateSigned, "", new { @class = "text-danger" })
</div>
<span class="btn btn-default"><span class=" fa fa-calendar"></span></span>
</div>
</div>

最佳答案

使用输入组:

http://getbootstrap.com/components/#input-groups

<div>
<div class="form-group">
<label for="" class="col-xs-5 control-label">
Contract Date Signed:
</label>
<div class="input-group col-xs-5">
<input class="form-control">
<span class="input-group-addon">
<i class="glyphicon glyphicon-calendar" aria-hidden="true"></i>
</span>
</div>
</div>
</div>

查看这个 jsfiddle:

http://jsfiddle.net/21Lfnq4e/

enter image description here

关于html - 如何摆脱输入和日历图标之间的空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28228548/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com