CSS 与表单域水平对齐

标签 css xhtml

我已经查看了关于这个主题的所有可能答案,但我终其一生都无法完成。

在此页上 http://dev.rpgplan.com/contact-us/我正在尝试像这张图片一样排列前 3 个字段 http://note.io/13eOJi7

但我得到的只是未对齐的字段。

最佳答案

在您使用的页面中 <br></br>在导致 lineBreak 的 3 个输入字段之间进行标记,所以这是我更改并认为可以解决您的问题的内容

<div class="wpcf7" id="wpcf7-f352-p353-o1"><form action="/contact-us/#wpcf7-f352-p353-o1" method="post" class="wpcf7-form" novalidate="novalidate">

<div style="display: none;">
...
</div>

<div id="inner-contact">

<span class="wpcf7-form-control-wrap first-name">  
   <input name="first-name" ... " type="text">
</span>
**[Omit <br></br>]**

<span class="wpcf7-form-control-wrap last-name">
   <input name="last-name" ... type="text">
</span>
**[Omit <br></br>]**

<span class="wpcf7-form-control-wrap email">
    <input name="email" ... type="email">
</span>
</div>
...
</div>
</form>
</div>

我还看到您的前 2 个字段有 ma​​rgin-top: 6px;ma​​rgin-bottom: 20px; 属性,但第 3 个字段有 ma​​rgin-top: 3px;ma​​rgin-bottom: 10px;!
所以像其他两个字段一样修复第 3 个字段的属性,就可以了。

关于CSS 与表单域水平对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17910842/

相关文章:

css - 哪些元素受 line-height 属性的影响?

html - 缩放 SVG 形状以适应内容,其中内容包括 foreignObject

javascript - 如何在 <area> 上添加边框?

css - 我的 php 表在 IE 中显示正常,但在 Chrome 中显示不正常

javascript - 使用 Python 将 HTML/CSS/Javascript 文件转换为 PDF?

ruby-on-rails - 决定反对 HAML/SASS 的原因有哪些?

mysql - 从以前的最新记录中选择一列

html - 高度增加到顶部方向

javascript - JQuery 切换图像 CSS

html - 一个 HTML 元素可以有多个 id 吗?