【发布时间】: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 上并添加了一些属性。谢谢!
标签: php html css wordpress forms