After a few hours of research and trial and error, I was finally able to add the new Google No Capatcha re Capatcha to my form and get it working, but for some reason, it won't center. Any ideas?
<!-- reCapatcha -->
<div id="capatcha">
<div class="g-recaptcha" data-sitekey=""></div>
</div>
#capatcha {
margin: 0 auto;
display: block
}
We're calling it the "No CAPTCHA reCAPTCHA" and this is how it looks: On websites using this new API, a significant number of users will be able to securely and easily verify they're human without actually having to solve a CAPTCHA. Instead, with just a single click, they'll confirm they are not a robot.
The easiest way of resizing Google recapture is by adding inline style. Inline styles are the CSS styles that applied directly to the HTML element by using the style attribute.
I went with:
<style>
/* already defined in bootstrap4 */
.text-xs-center {
text-align: center;
}
.g-recaptcha {
display: inline-block;
}
</style>
<div class="text-xs-center">
<div class="g-recaptcha" data-sitekey=""></div>
</div>
This is similar to other answers, but I thought worth sharing. I don't like hard-coding values, but the width of the No Captcha reCAPTCHA appears to be 304px, so you could use that as your width:
<style>
div.g-recaptcha {
margin: 0 auto;
width: 304px;
}
</style>
<!-- reCAPTCHA -->
<div class="g-recaptcha" data-sitekey=""></div>
This should center the reCAPTCHA exactly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With