首页 > 解决方案 > 发送 php 表单后,如何编辑“新”确认页面?

问题描述

发送 PHP 联系表单并显示确认消息:我需要白色背景的 div 为整列。如果我在消息上添加边距,它会破坏如图所示的布局。我仍然围绕着 PHP 逻辑在交互方面的结构如何,不确定在哪里调整它并解决问题。

我的代码结构如下:

<div id="whitebox" class="whitebox">
<div class="text-center orange-navbar">
      <nav role="navigation">
<ul class="navcen nav nav-pills" >
  <li role="presentation"><a href="index.html">Home</a></li>
  <li role="presentation"><a href="portfolio.html">Portfolio</a></li>
  <li class="active" role="presentation"><a href="contact.html">Contact</a></li>
  </ul>
</nav>
    </div>

    
    <?php if(!empty($emailSent)): ?>
        <div class="col-md-6 col-md-offset-3">
            <div class="alert alert-success text-center"><?php echo $config->get('messages.success'); ?></div>
        </div>
    <?php else: ?>
        <?php if(!empty($hasError)): ?>
        <div class="col-md-5 col-md-offset-4">
            <div class="alert alert-danger text-center"><?php echo $config->get('messages.error'); ?></div>
        </div>
        <?php endif; ?>

联系表成功响应

标签: phphtmlcss

解决方案


将此添加到您的CSS:

.whitebox {
  height: 100vh;
}

这将使您的whiteboxdiv 的高度为视口的 100%。


推荐阅读