No CAPTCHA reCAPTCHA Resizing

前端 未结 14 1970
故里飘歌
故里飘歌 2020-12-14 01:23

Hi I just added Google\'s No CAPTCHA reCAPTCHA to my website, and I am running into a small little issue. It does NOT fit on my mobile website, and that is

相关标签:
14条回答
  • 2020-12-14 01:47

    By using the CSS transform property you can achieve changing the width by changing the entire scale of the reCAPTCHA.

    By adding in just two inline styles, you can make the reCAPTCHA fit nicely on your mobile device:

    <div class="g-recaptcha"
         data-theme="light"
         data-sitekey="XXXXXXXXXXXXX"
         style="transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;">
    </div>
    

    More details can be found on my site: https://www.geekgoddess.com/how-to-resize-the-google-nocaptcha-recaptcha/

    0 讨论(0)
  • 2020-12-14 01:47
    <div class="g-recaptcha" data-theme="light" data-sitekey="your site key" style="transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div>
    

    This working for me, you try it..

    0 讨论(0)
  • 2020-12-14 01:48

    Hope you find this useful

    @media only screen and (max-width : 480px) {
        .smallcaptcha{
            transform:scale(0.75);
            transform-origin:50% 50%;
        }
    
    }
    
    0 讨论(0)
  • 2020-12-14 01:49
    <div class="g-recaptcha" data-theme="dark"></div>
    
    0 讨论(0)
  • 2020-12-14 01:50

    Hope this works for you.

    <div class="g-recaptcha" data-theme="light" data-sitekey="XXXXXXXXXXXXX" style="transform:scale(0.77);transform-origin:0 0"></div>
    

    Just add style="transform:scale(0.77);transform-origin:0 0"

    0 讨论(0)
  • 2020-12-14 01:59

    On my site the re-captcha was getting cut off and looked bad.

    After some experimentation I was able to fix the cutoff issue with this style update:

    <style>
      .g-recaptcha>div>div>iframe {
         width: 380px;
         height: 98px;
      }
    </style>
    

    0 讨论(0)
提交回复
热议问题