gpt4 book ai didi

html - 并排对齐表单上的输入框

转载 作者:太空宇宙 更新时间:2023-11-04 15:10:24 24 4
gpt4 key购买 nike

我正在尝试并排对齐表单的输入文本框,但我无法这样做。请帮忙。

fiddle :here

HTML:

<p>Your Name
<br>
<span class="wpcf7-form-control-wrap your-name">
<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true"
</span>
</p>
<p>Your Email
<br>
<span class="wpcf7-form-control-wrap your-email">
<input type="email" name="your-email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7- validates-as-email" aria-required="true">
</span>
</p>

CSS:

.wpcf7 input[type="text"], .wpcf7 input[type="email"] {
background-color: #fff;
color: #000;
width: 50%;
}

最佳答案

http://jsfiddle.net/rHh3w/12/show

只需要将您的p 元素设置为“display:inline;”,默认情况下它们是 block 元素并且不会彼此相邻对齐。

还删除了两个br标签

p {display:inline;}

关于html - 并排对齐表单上的输入框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20281884/

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