Search code examples
cssrecaptcha

Google reCAPTCHA background CSS color


I'm using Google's reCAPTCHA like this in my html: <div class="g-recaptcha" data-sitekey=""></div> and also adding this script <script src='https://www.google.com/recaptcha/api.js'></script>. How can I get rid of the dark grey background? I've tried changing the background-color of the recaptcha_response_field but it doesn't change anything.

current reCAPTCHA


Solution

  • I solved the issue by removing the background color for the iframe that Google reCAPTCHA creates.

    This is what Google reCAPTCHA creates:

    <div class="g-recaptcha" data-sitekey="">
       <div style="width: 304px; height: 78px;">
          <div>
             <iframe title="reCAPTCHA" src="" width="304" height="78" role="presentation" name="a-cvin5ubac2l0" frameborder="0" scrolling="no" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox"></iframe>
          </div>
       </div>
    </div>
    
    

    I changed the css for that iframe to background-color: inherit;