wordpress Contact form 7验证未与相应的输入对齐
Posted
技术标签:
【中文标题】wordpress Contact form 7验证未与相应的输入对齐【英文标题】:wordpress Contact form 7 validation not aligning to respective input 【发布时间】:2017-11-12 20:54:28 【问题描述】:我在我的 Wordpress 网站上有插件“联系表格 7”,但我一直不知道如何正确对齐验证消息。
这是我尝试输出设计时的反应。
这是我添加到“联系表单 7”中的 html 表单。
[response]
[text* your-name class:rounded-input class:cols-4 placeholder "Your Name"]
[text* your-position class:rounded-input class:cols-4 placeholder "Position"]
[text* company class:rounded-input class:cols-4 placeholder "Company Name"]
[email* your-email class:rounded-input class:cols-4 placeholder "Email Name"]
<label class="center-content">
[checkbox* agreement class:rounded-input "I’m looking for the best solution with fantastic local support."]
</label>
[submit class:button "Get a Solution"]
<p><small>*Your privacy is very important to us. To learn more about our information processesing procedures, please visit our <a href="#">Privacy Policy</a>.</small></p>
然后这是我的 php 文件中的 HTML:
<footer class="contact-form clearfix" style="background-image: url(<?php echo get_template_directory_uri(); ?>/img/contact-bg.png)">
<div class="form-holder">
<h2>Together, we’ll do great.</h2>
<p> Cras venenatis feugiat nibh quis tempus. Quisque libero nibh, consequat posuere,<br> tempus pulvinar purus.</p>
<?php echo do_shortcode('[contact-form-7 id="66" title="Contact form"]'); ?>
</div>
</footer>
那么这是我的页脚表单的样式表:
.form-holder
text-align: center;
padding: 20px 5%;
color: #fff;
.rounded-input
max-width: 1020px;
margin: 20px auto;
.rounded-input.cols-4
border: 1px solid #fff;
border-radius: 3px;
width: 23%;
margin: 15px 1%;
background: transparent;
color: #fff;
我正在考虑将它们包装在 div
中。
【问题讨论】:
验证消息的 css 是什么?以及相应的html。我认为它只是一个位置或显示属性。 添加生成的 HTML(带有错误消息),这样会更容易调试。 我已经完成了将每个输入包装在一个 div 上并添加了一些属性。谢谢! 【参考方案1】:在你的 html 中你已经分配了 18 列,你只能使用 12 列,所以将简码更改为
[text* your-name class:rounded-input class:cols-3 placeholder "Your Name"]
【讨论】:
以上是关于wordpress Contact form 7验证未与相应的输入对齐的主要内容,如果未能解决你的问题,请参考以下文章
Wordpress Contact Form 7 集成 WP Webhook 不工作
wordpress插件Contact Form 7 邮件收不到附件
Wordpress Contact form 7 html整合问题
WordPress Contact-Form 7 收到的邮件内容为空