Change New Google Recaptcha (v2) Width
We've just started to implement the new google recaptcha as listed https://www.google.com/recaptcha/intro/index.html
However the new method seems to be contained within an iFrame rather than embedded into the page thus making applying CSS more difficult.
However we've got our form which is 400px wide so would like to have the recaptcha the same width.
Currently it looks like, however we'd like it the same with as the rest.
Does anybody know how to do this yet?
Thanks
Here is a work around but not always a great one, depending on how much you scale it. Explanation can be found here: https://www.geekgoddess.com/how-to-resize-the-google-nocaptcha-recaptcha/
.g-recaptcha {
transform:scale(0.77);
transform-origin:0 0;
}
UPDATE: Google has added support for a smaller size via a parameter. Have a look at the docs - https://developers.google.com/recaptcha/docs/display#render_param
No, currently you can not. It was only possible with the old recaptcha, but I'm sure you will be able to do that in the future.
I have no solution but a suggestion. I had the same problem, so I centered the recaptcha div
(margin: 0 auto;display: table
), I think it looks much better than a left-aligned div.
For more compatibility:
-webkit-transform: scale(0.77);
-moz-transform: scale(0.77);
-ms-transform: scale(0.77);
-o-transform: scale(0.77);
transform: scale(0.77);
-webkit-transform-origin: 0 0;
-moz-transform-origin: 0 0;
-ms-transform-origin: 0 0;
-o-transform-origin: 0 0;
transform-origin: 0 0;