gpt4 book ai didi

html - 使用 Bootstrap 对齐输入框下的标签

转载 作者:太空宇宙 更新时间:2023-11-03 21:48:00 24 4
gpt4 key购买 nike

我不确定如何在这里获得我想要的效果。我有两个位于同一行的输入框,我想在它们下面放置标签并对齐以匹配相应的输入框。

<div class="container">
<form class="form-inline" role="form">
<div class="form-group">
<label for="decimal_input">Label 1</label>
<input type="text" value="1" width="10" id="decimal_input" class="form-control" />
= <label for="input2">Label 2</label>
<input type="text" value="I" width="30" id="input2" class="form-control" />
</div>
</div>
</form>

查看此处的 jsfiddle 以获取更多信息:

http://jsfiddle.net/justinhj/bTVKZ/2/

最佳答案

http://jsfiddle.net/isherwood/bTVKZ/6

<div class="container">
<form class="form-inline" role="form">
<div class="form-group">
<div class="pull-left">
<input type="text" value="1" width="10" id="decimal_input" class="form-control" />
<br />
<label for="decimal_input">Label 1</label>
</div>
<div>
<input type="text" value="I" width="30" id="input2" class="form-control" />
<br />
<label for="input2">Label 2</label>
</div>
</div>
</form>
</div>

关于html - 使用 Bootstrap 对齐输入框下的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19354605/

24 4 0
文章推荐: html - 绝对位置 div 在父 div 中消失
文章推荐: c# - 我可以定义一个 Type 变量,表示特定类的子类型的类型是唯一有效值吗?
文章推荐: javascript - 使用 JS/CSS 将 转换为具有完全相同位置和形状的
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com