ReCaptcha is not really responsive.
As I have the problem now, the recaptcha has a fixed size and should be responsive. Here is a bug ticket from februrary: https://code.google.com/p/recaptcha/issues/detail?id=215
It's too bad it isn't responsive indeed. The only decent workaround I have found so far is scaling the whole thing down a bit with css transform.
You can also try specifying the data-size="compact" attribute. Though, this does only affect the initial display of the widget, not the potential additional UI if further verification is needed.
The image select box is now broken with an annoying text area :disappointed:, hoping someone can submit a fix.
@huynhquancam do you have a screenshot or a way to reproduce?
@rowan-m thanks, here is the screenshot from my localhost
and also the HTML generated
<div class="form-group">
<script src="//www.google.com/recaptcha/api.js" async="" defer=""></script>
<div class="g-recaptcha" data-sitekey="XXX">
<div>
<div style="width: 302px; height: 422px; position: relative;">
<div style="width: 302px; height: 422px; position: absolute;">
<iframe src="https://www.google.com/recaptcha/api/fallback?k=XXX&hl=en&v=r20150812220525&t=1&ff=true" frameborder="0" scrolling="no" style="width: 302px; height:422px; border-style: none;"></iframe>
</div>
</div>
<div style="border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px; height: 60px; width: 300px;">
<textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none; "></textarea>
</div>
</div>
</div>
<noscript><div style="width: 302px; height: 352px;"> <div style="width: 302px; height: 352px; position: relative;"> <div style="width: 302px; height: 352px; position: absolute;"> <iframe src="//www.google.com/recaptcha/api/fallback?k=XXX" frameborder="0" scrolling="no" style="width: 302px; height:352px; border-style: none;"> </iframe> </div> <div style="width: 250px; height: 80px; position: absolute; border-style: none; bottom: 21px; left: 25px; margin: 0px; padding: 0px; right: 25px;"> <textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 80px; border: 1px solid #c1c1c1; margin: 0px; padding: 0px; resize: none;" value=""> </textarea> </div> </div> </div></noscript>
</div>
Here is a hack that worked for me:
.gc-reset{ transform:scale(0.95) !important; -webkit-transform:scale(0.95) !important; transform-origin:0 0 !important; -webkit-transform-origin:0 0 !important; }
gc-reset is a class that is used in three wrappers around the imageselect, so the transform is applied three times.
@recfish That's how I did it as well, not very beautiful but it works.
Why is this not being fixed? A lot of websites are responsive, and a lot of traffic goes via mobile devices. It makes no sense that recaptcha is not responsive as well.
I really agree with that but for me, as a workaround the scale thing was working for me.
Hopefully scaling this will work across devices but seriously.... Why isn't this fixed yet????
+1... It's sort of unbelievable that this is not responsive. And what's with the id-less, class-less div wrapping the iframe with a set width? or is that just the rails Gem doing that??
+1 It's really not responsive :/ , Any news?

For Bootstrap 3 (+ 480px breakpoint hack) the following code (written in SCSS) partially solved my problem:
// Extra small (<480px)
@media(max-width: $screen-xs-max){
.g-recaptcha iframe {
max-width: 100%;
transform:scale(0.77);
-webkit-transform:scale(0.77);
transform-origin: center center;
-webkit-transform-origin: center center;
}
#rc-imageselect {
transform:scale(0.77);
-webkit-transform:scale(0.77);
transform-origin:0 0;
-webkit-transform-origin:0 0;
}
}
// Medium small (>=480px)
@media(min-width: $screen-ms-min){
#rc-imageselect {
transform: none;
-webkit-transform: none;
}
.g-recaptcha iframe {
max-width: none;
transform: none;
-webkit-transform: none;
}
}
// Horizontally center the recaptcha - applied to all widths
.g-recaptcha > div > div{
margin: 4px auto !important;
text-align: center;
width: auto !important;
height: auto !important;
}
This code will horizontally center your recaptcha and scale it when width less than 480px. However, this code also hides part of the recaptcha when you have a device with less than ~403px wide.
There's anyone here with more css skills than I that can solve this problem?
Code based on How to resize the Google noCAPTCHA reCAPTCHA. Btw Google, please implement responsiveness support.
Any plans or update if and when it would be made responsive? @rowan-m
My solution is a pure JS approach. Using jquery + bootstrap 3 (img-responsive class).. though im sure it's quite easy to pull out that little bit of css related to img-responsive.
var recaptchaCallback = function () {
$('.g-recaptcha').each(function() {
var rc = grecaptcha.render(this, {
'sitekey' : ..,
'theme': ..,
'callback': ..
});
$(this).find('iframe:first')
.removeAttr('width')
.addClass('img-responsive')
.parent()
.css('width', 'auto');
});
};
On small smartphones (iPhone 3, S3 mini) it's even worse: the re-captcha container gets cut off on the right. A lot of our mobile visitors still use these kind of small smartphones. It's actually quite unbelievable that Google, the creator of so many great frameworks and fierce supporter of mobile front-ends, is not capable of or willing to do a responsive re-captcha.
Just label this: won't fix
@goldhand because of? There should be a reason for doing a won't fix. All the solutions are workarounds for me.
@goldhand @Chris2011: There's indeed no solution yet, it should be fixed. Right now it's little hacks and workarounds. And when the test is displayed it's completely broken. I don't understand how this bug is still open after all these months.
@Chris2011 sorry for my sarcasm. It's been almost a year since this issue's been open but that's not an excuse to be negative.