简体   繁体   English

对齐文本插件引导HTML

[英]Align text addons bootstrap html

I am trying to create a form using Bootstrap and I am having trouble getting the text in the addons to line up correctly. 我正在尝试使用Bootstrap创建表单,但无法使插件中的文本正确排列。 I want the addon size to be the same for every input group. 我希望每个输入组的插件大小都相同。 Here is my html: 这是我的html:

<div class="input-group"><span class="input-group-addon">Event Name</span><input type="text" class="form-control" placeholder="Ex. Bingo" id="event"></div>

<div class="input-group"><span class="input-group-addon">Mon</span><input type="text" class="form-control" placeholder="00:00" id="mon"></div>

<div class="input-group"><span class="input-group-addon">Tue</span><input type="text" class="form-control" placeholder="00:00" id="tues"></div>

<div class="input-group"><span class="input-group-addon">Wed</span><input type="text" class="form-control" placeholder="00:00" id="wed"></div>

<div class="input-group"><span class="input-group-addon">Thu</span><input type="text" class="form-control" placeholder="00:00" id="thurs"></div>

<div class="input-group"><span class="input-group-addon">Fri</span><input type="text" class="form-control" placeholder="00:00" id="fri"></div>

<div class="input-group"><span class="input-group-addon">Sat</span><input type="text" class="form-control" placeholder="00:00" id="sat"></div>

<div class="input-group"><span class="input-group-addon">Sun</span><input type="text" class="form-control" placeholder="00:00" id="sun"></div>

Any help is greatly appreciated 任何帮助是极大的赞赏

If you are trying to get the width of the labels to be the same, you add to the css class like so: 如果尝试使标签的宽度相同,则将其添加到css类中,如下所示:

.input-group-addon {
    width: 150px;
}

JSFiddle: http://jsfiddle.net/biz79/j2m9ng9p/ JSFiddle: http : //jsfiddle.net/biz79/j2m9ng9p/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM