Reputation: 81
I am struggling to find a way to override google's new recaptcha styling. I believe the new version loads its styling from within the api JS file.
Would anyone know how to override this to make it responsive within bootstrap?
<script src="https://www.google.com/recaptcha/api.js?render=onload"></script>
<div class="g-recaptcha" data-sitekey="key"></div>
Upvotes: 2
Views: 6687
Reputation: 3745
Use the below mentioned code
.g-recaptcha {transform: scale(0.85); transform-origin: left top;}
Upvotes: 2
Reputation: 11
I would add just one more things to Boukraa Mohamed idea:
.g-recaptcha > iframe
This way it will work even if the iframe down-inside of multiple div tags.
Upvotes: 1
Reputation: 21
just make the iframe responsive like this
.g-recaptcha{
position: relative;
padding-bottom: 56.25%;
padding-top: 0px;
height: 0;
overflow: hidden;
}
.g-recaptcha iframe{
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}
this will make it res
Upvotes: 2
Reputation: 49054
Your question makes not clear which properties you want to override.
The Google's code loads an iframe in the div with class g-recaptcha
. The iframe has its own styles sheets. You can manipulate the style sheets in an iframe with javascript or jQuery, see: How to apply CSS to iframe?.
Before using jQuery to manipulate the style sheets you should make sure that the iframe had loaded. See: https://developers.google.com/recaptcha/docs/display#explicit_render it seems that the api does not provide a function to trigger this onload event.
Upvotes: 0