【问题标题】:mail form breaking website layout邮件表单破坏网站布局
【发布时间】:2014-12-29 03:00:48
【问题描述】:

我有这个模板。我所做的只是下载整个模板并将其上传到服务器,当您使用表单提交查询时,布局中断和发送的成功消息不会显示。这可以在http://www.sgrooms.esy.es查看。布局来自http://www.wowthemes.net/demo/hypnos/,表单可以正常工作。 我已经比较了我可以看到的文档,但我看不到错误。

是否有人能够帮助我,而不必等到他们的支持开放?

这是我认为出错的代码:

<!-- CONTACT
================================================== -->
<section id="contact-page" class="maincolorbg">
<div class="container">
    <div class="starter-template">
        <h1>Contact</h1>

        <div class="smallsep">
        </div>
        <p class="lead">
            Send us a message to request a free no obligation quotation,<br/>
            or simply enquire and get prompt answers within 24 hours.
        </p>
    </div>
    <form id="contact" name="contact" method="post">
        <fieldset>
            <div class="row">
                <div class="col-md-4 wow fadeIn animated animated" data-wow-delay="0.1s" data-wow-duration="2s">
                    <label for="name" id="name">Name<span class="required">*</span></label>
                    <input type="text" name="name" id="name" size="30" value="" required/>
                </div>
                <div class="col-md-4 wow fadeIn animated" data-wow-delay="0.3s" data-wow-duration="2s">
                    <label for="email" id="email">Email<span class="required">*</span></label>
                    <input type="text" name="email" id="email" size="30" value="" required/>
                </div>
                <div class="col-md-4 wow fadeIn animated" data-wow-delay="0.5s" data-wow-duration="2s">
                    <label for="phone" id="phone">Phone<span class="required">*</span></label>
                    <input type="text" name="phone" id="phone" size="30" value=""/>
                </div>
            </div>
            <div class="wow fadeIn animated" data-wow-delay="0.8s" data-wow-duration="1.5" style="margin-top:15px;">
                <label for="Message" id="message">Message<span class="required">*</span></label>
                <textarea name="message" id="message" required></textarea>
            </div>
            <div class="wow fadeIn animated" data-wow-delay="1s" data-wow-duration="2s">
                <input id="submit" type="submit" name="submit" value="Send"/>
            </div>
        </fieldset>
    </form>
    <div id="success">
    <span>
    <p style="margin-top:20px;">
        Your message was sent successfully! I will be in touch as soon as I can.
    </p>
    </span>
    </div>
    <div id="error">
    <span>
    <p>
        Something went wrong, try refreshing and submitting the form again.
    </p>
    </span>
    </div>
</div>
</section>

这是css:

#contact label {
text-transform:uppercase;
font-weight:300;
}
#contact input,#contact select,#contact textarea {
font-family:inherit;
font-size:inherit;
line-height:inherit;
width:100%;
border:0px;
color:#333;
}
#contact input,#contact select {
border:0px;
height:40px;
margin-bottom:0px;
}
#contact input#submit {
width:auto;
margin-top:20px;
background-color:#333;
color:#fff;
padding:0px 20px;
text-transform:uppercase;
font-weight:300;
}
#contact textarea {
height:200px;
}
.required {
color:#e9266d
}

#success,#error {
display:none
}
#success span,#erro span {
display:block;
position:absolute;
top:0;
width:100%
}
#success span p,#error span p {
margin-top:6em
}
#success span p {
color:#9bd32d;
}
#error span p {
color:#c0392b;
}
.error {
text-transform: none;
font-style: italic;
display: inline-block;
}

【问题讨论】:

  • 抱歉,这里没有人愿意挖掘其他人的大量代码。如果您需要我们的帮助,那么您必须发布一个简单的(简化的)示例来演示您的问题以及简化的代码。懒惰并且只发布一些任意网站的链接在这里被认为是一种坏习惯。
  • 我在上面添加了可疑代码
  • &lt;p&gt; 放在&lt;span&gt; 里面是没有意义的。通过 W3C 验证器运行您的标记以查看任何无效的 HTML。
  • 当您的问题不包含这些内容时,请不要使用bootstrapjqueryphp 标签。
  • @sparky - 该模板是一个使用 jquery 邮件表单的引导模板,该表单还包含 php。如果需要,我也可以上传这些代码

标签: html css layout


【解决方案1】:

这是我自己想出来的。

如果有人发现相同的问题,请查看下面的答案。

    <div id="success">

        <p style="margin-top:20px;">

            Your message was sent succssfully! I will be in touch as soon as I can.
        </p>

    </div>
    <div id="error">
    <span>
    <p>
        Something went wrong, try refreshing and submitting the form again.
    </p>
    </span>
    </div>
</div>
</section>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-06-12
    • 2021-12-10
    • 2011-11-17
    • 2020-08-27
    • 2014-01-09
    • 1970-01-01
    • 2012-02-25
    相关资源
    最近更新 更多