gpt4 book ai didi

HTML CSS 如何在其他列中居中选择

转载 作者:行者123 更新时间:2023-11-28 01:25:29 26 4
gpt4 key购买 nike

我在一行内容中选择了以下内容,我希望将它们更好地对齐/间隔到右侧:

enter image description here

即选择“许可证数量”旁边的。我想将数字向右移动更多,这样在视觉上看起来更合适。

代码如下:

<div class="field-group">

<div style="text-align: center;" class="field field--with-dropdown clearfix">
<label for="field-qty">License Quantity</label>
<select style="text-align: center; margin-left: 25em" id="field-qty-num" onchange="qty_change()">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
</select>

</div>

<div class="field">
<label for="field-phone">User Training Manual</label>
<input id="field-phone" type="text" class="form-control" style="text-align: center;" placeholder="Included for free!" readonly />
</div>

<div class="field">
<label for="field-phone">User Training Videos</label>
<input id="field-phone" type="text" class="form-control" style="text-align: center;" placeholder="Included for free!" readonly />
</div>

<div class="field">
<label for="field-phone">6 Months Tech Support</label>
<input id="field-phone" type="text" style="text-align: center;" class="form-control" placeholder="Included for free!" readonly />
</div>

</div>

最佳答案

如果不对特定宽度进行硬编码,您可以采用 flexbox 方法:

<div style="display:flex;justify-content:space-between;/*or space-evenly*/" class="field field--with-dropdown clearfix"> 
<label for="field-qty">License Quantity</label>
<select id="field-qty-num" onchange="qty_change()">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
</select> </div>

关于HTML CSS 如何在其他列中居中选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51274044/

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