【发布时间】:2019-11-21 00:14:12
【问题描述】:
我有这个 html 文本
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="glossary-form"></div>
<div class="form-group" style="display:inline-block; width:48%;padding-right: 5%;">
<label for="glossary_entry_input_1">Lemma IT</label>
<input type="text" class="form-control" id="glossary_entry_input_1" placeholder="">
</div>
<div class="form-group" style="display:inline-block; width:48%; padding-left: 5%;">
<label for="glossary_entry_input_2">Lemma CH</label>
<input type="text" class="form-control" id="glossary_entry_input_2" placeholder="">
</div>
<div class="form-group">
<label for="glossary_entry_input_3">Acronimo IT</label>
<small id="inputHelp" class="form-text text-muted">Inserire una sigla (se esiste) del Lemma. Nel caso in cui il lemma sia una grandezza fisica, inserire la lettera o il simbolo che la identifica.</small>
<input type="text" class="form-control" id="glossary_entry_input_3" placeholder="">
</div>
</div>
生成以下表单域,在一行上对齐,如您所见
我想通过将第二个向右移动,如您所见,将它们与我的 html 页面的垂直轴对称地显示
使“引理 CH”框的左边距与“Acronimo IT”框之一对齐。 如何更改我的代码才能获得第二张图片中显示的结果?
【问题讨论】:
-
您正在使用引导程序,因此请根据您的要求使用引导程序网格
-
在第二张图片中,“引理 CH”框向右移动了一点,使其右边距与下面的“Acronimo IT”框相同。
-
请创建一个有效的 sn-p 我们将能够为您提供帮助。
-
感谢 Sumit Patel。我添加了工作的 sn-p。
-
@Tms91 我给个答案。检查。它可能会帮助你。
标签: css forms css-float styling border-box