【问题标题】:wordpress Contact form 7 validation not aligning to respective inputwordpress Contact form 7验证未与相应的输入对齐
【发布时间】: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


【解决方案1】:

在你的 html 中你已经分配了 18 列,你只能使用 12 列,所以将简码更改为

[text* your-name class:rounded-input class:cols-3 placeholder "Your Name"]

【讨论】:

    猜你喜欢
    • 2018-04-06
    • 1970-01-01
    • 2022-07-26
    • 1970-01-01
    • 1970-01-01
    • 2014-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多