gpt4 book ai didi

html - 对齐 <input> 和

转载 作者:可可西里 更新时间:2023-11-01 13:17:38 24 4
gpt4 key购买 nike

我有一个有序列表,其中有一个 <input type="text"...<button> field 。当我渲染它们时,我在 2 个单独的行中得到字段。我如何让他们排在同一行?

HTML-

<li>
<input type="text" value="Paste URL here"></input>
<button id="i">Go</button>
</li>

我什至从 <li> 中删除了它们并将它们放在单独的 <div> 中没有成功。需要在此处添加什么 CSS 来克服此默认行为?

更新:我现在已经从有序列表中删除了这 2 个标签并将它们放在 <div> 中.现在看起来像这样 -

<div style="display: inline-block">
<input id="url" type="text" value="Paste URL here"></input>
<button id="i" style="font-size:10px; margin:2px;">Go</button>
</div>

对尝试没有影响float:left;display:inline-block .

最佳答案

<div style="width: 100%;">
<input type="text" style="float: left; width: 200px;" id="url" value="Paste URL here">
<button style="font-size: 10px; margin: 2px; float: left;" id="i">Go</button>
</div>

关于html - 对齐 &lt;input&gt; 和 <button> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4212084/

24 4 0
文章推荐: html - css 中的
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com