这里有一个功能齐全的reCAPTCHA小部件。它是一个更大的HTML表单的一部分,我很难调整从返回的图像
<?php echo recaptcha_get_html($public_key); ?>
向表单本身添加任何填充/边距都会向右移动,但我只需要调整小部件。我的答案是否在于一个CSS属性,我可以用它来包围这个PHP脚本?
如果有帮助的话,我会展示整个表格。。。提前感谢您的任何提示或解决方案。
<form id="feedback" method="post" action="">
<p>
<label for="name">Name:</label>
<input name="name" id="name" type="text" class="formbox"
<?php if ($missing || $errors) {
if(isset($name)){
echo 'value="' . htmlentities($name, ENT_COMPAT, 'UTF-8') . '"';
}
} ?>>
<?php if ($missing && in_array('name', $missing)) { ?>
<span class="warning"><font color="red">Please enter your name</font></span>
<?php } ?>
</p>
<p>
<label for="email">Email:</label>
<input name="email" id="email" type="text" class="formbox"/
<?php if ($missing || $errors) {
if(isset($email)){
echo 'value="' . htmlentities($email, ENT_COMPAT, 'UTF-8') . '"';
}
} ?>>
<?php if ($missing && in_array('email', $missing)) { ?>
<span class="warning"><font color="red">Please enter your email address</font></span>
<?php } elseif (isset($errors['email'])) { ?>
<span class="warning"><font color="red">Invalid email address</font></span>
<?php } ?>
</p>
<p>
<label for="comments">Comments:
<?php if ($missing && in_array('comments', $missing)) { ?>
<span class="warning"><font color="red">Please enter your comments</font></span>
<?php } ?>
<br /></label>
<textarea name="comments" id="comments" cols="60" rows="8"><?php
if ($missing || $errors) {
if(isset($comments)){
echo htmlentities($comments, ENT_COMPAT, 'UTF-8');
}
} ?></textarea>
</p>
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'white'
};
</script>
<?php
//Display the error message if the values don't match.
if (isset($errors['recaptcha'])) { ?>
<p><font color="red">The values didn't match. Try again.</font></p>
<?php } ?>
<?php echo recaptcha_get_html($public_key); ?>
<p>
<input name="send" id="send" type="submit" value="Send message" />
</p>
</form>
这正是您所需要的。。
CSS
#recaptcha_widget_div {
margin-left: 18px;
}
HTML
<div id="recaptcha_widget_div">
<?php echo recaptcha_get_html($public_key); ?>
</div>