【问题标题】:reCAPTCHA centrally alignedreCAPTCHA 居中对齐
【发布时间】:2013-12-17 09:19:40
【问题描述】:

我对 PHP 很陌生!在提交表单之前,我已经设法让我的 reCAPTCHA 框位于页面的中心,但是一旦提交了表单,recaptcha 框和表单就会被分流到左侧,而结果显示在中心对齐。

有谁知道我如何确保表单提交后不会移动?

对不起,我对 PHP/CSS/HTML 很陌生 这是我的表单的 PHP HTML 代码

<div id="form">
<form method="post" action="niindex.php"><table>
<th><h2>I am searching for</h2><th>
<tr><td><select name="categories"><?php echo $str_options; ?></select></td></tr>
<br /> 
<tr><td><?php echo recaptcha_get_html($publickey); ?></td></tr>
<tr><td><input type="submit" id="submit" name="submit" value="Submit" /></td></tr>
</table></form>

这是我的表单 CSS:

#form{
font-family:"Century Gothic";
border:2px dotted #FFB6D7;
text-align:center;
display:inline-block;
padding-top:25px;
padding-bottom:25px;
padding-right:100px;
padding-left:100px;

}

【问题讨论】:

  • 那是一些无效的 HTML。 th 需要在 tr 中,并且您不能在其中有 &lt;br /&gt;。你从recaptcha_get_html 得到的代码是什么样的?
  • 我已经修改了那些错误,谢谢!这仍然没有解决我提交后盒子向左移动的问题

标签: php jquery html css forms


【解决方案1】:

试试这种风格:-

<div class="captcha">
     Your Captcha code.
</div>

#recaptcha_area {
width: 440px;
margin: auto;
}

【讨论】:

    【解决方案2】:

    像这样通过: td{ text-align:center; vertical-align:middle; }

    【讨论】:

      【解决方案3】:


      1.将recapcha放在&lt;center&gt;&lt;/center&gt;标签中

      2.

      #recapchaPar {
        width: 500px;
        margin: 0 auto;
        text-align:center;
        border: 1px solid #ccc;
      }
      <div id="recapchaPar">
        123<!-- recapcha code here -->
      </div>



      3.

      #recapchaPar {
        width: 10vw;;
        margin: 0 45vw;/* 50vw - width of #recapchaPar/2 */
        text-align:center;
        border: 1px solid #ccc;
      }
      <div id="recapchaPar">
        123<!-- recapcha code here -->
      </div>

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-04-02
        • 2015-07-25
        • 1970-01-01
        • 2021-06-01
        • 2011-03-13
        • 2016-08-17
        • 2011-11-29
        • 2013-02-22
        相关资源
        最近更新 更多