reCAPTCHA集中对齐

时间:2013-12-17 09:19:40

标签: php jquery html css forms

I have uploaded a photo of my problem

我是PHP新手!在表单提交之前,我已经设法将我的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;

}

3 个答案:

答案 0 :(得分:0)

试试这个风格: -

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

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

答案 1 :(得分:0)

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

答案 2 :(得分:0)

1
。在android:gravity="bottom"标记内放置r​​ecapcha

2。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical"
              android:weightSum="1">

    <!-- Top Gravity -->
    <LinearLayout
            android:gravity="top"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@android:color/holo_green_light"
            android:orientation="vertical"
            android:layout_weight="0.5">

        <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Please place me at very top"/>

        <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/background_light"
                android:text="TextView"/>

    </LinearLayout>

    <!-- Bottom Gravity -->
    <LinearLayout
            android:gravity="bottom"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="0.50"
            android:background="@android:color/holo_red_light"
            android:orientation="vertical">

        <Button
                android:layout_width="match_parent"
                android:layout_height="62dp"
                android:text="Button"/>

        <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/background_light"
                android:text="Please place me at very bottom"/>

    </LinearLayout>

</LinearLayout>
<center></center>



3。

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