How do you set the badge position with reCAPTCHA v3?

前端 未结 6 1319
长发绾君心
长发绾君心 2020-12-29 05:05

I would like to use an inline badge with v3, but there is no documentation on badge position for v3.

6条回答
  •  梦毁少年i
    2020-12-29 05:37

    EDIT1: See the answer using the render=explicit parameters. This answer still works but it was before this feature was documented and not as clean.


    I've managed to do just that by placing a relative box and detaching the reCaptcha v3 badge into it. Then some style adjustments are made to the container.

    #grecaptcha-box {
        width: 260px;
        overflow: hidden;
        position: relative;
        height: 75px;
    }
    #grecaptcha-box .grecaptcha-badge {
        box-shadow: none !important;
    }
    

    Then you place the box followed by your JavaScript.

提交回复
热议问题