更改新的Google Recaptcha(v2)宽度 [英] Change New Google Recaptcha (v2) Width

查看:205
本文介绍了更改新的Google Recaptcha(v2)宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们刚刚开始实施列在 https://www的新Google验证码.google.com/recaptcha/intro/index.html

We've just started to implement the new google recaptcha as listed https://www.google.com/recaptcha/intro/index.html

但是,新方法似乎包含在iFrame中,而不是嵌入到页面中,因此使CSS的应用更加困难.

However the new method seems to be contained within an iFrame rather than embedded into the page thus making applying CSS more difficult.

不过,我们的表单宽度为400像素,因此希望将Recaptcha设置为相同的宽度.

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.

有人知道怎么做吗?

谢谢

推荐答案

这是一个变通方法,但不一定总能奏效,这取决于您要扩展多少.可以在这里找到说明: https://www.geekgoddess.com/how-to -resize-the-google-nocaptcha-recaptcha/

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;
}

更新: Google通过参数添加了对较小尺寸的支持.看看文档- https://developers.google.com/recaptcha/docs/display#render_param

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

这篇关于更改新的Google Recaptcha(v2)宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆