DEV Community

Cover image for How to make the Google reCAPTCHA responsive?
Shiva Aryal
Shiva Aryal

Posted on

How to make the Google reCAPTCHA responsive?

Google reCAPTCHA is a popular tool used by websites to prevent spam and abuse by bots. Making it responsive means ensuring that it works seamlessly on all devices, including mobile devices with smaller screens. 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. You can make the captcha responsive by simply adding below code to your global CSS:

<style>
@media only screen and (max-width: 500px) {
    .g-recaptcha {
        transform:scale(0.77);
        transform-origin:0 0;
    }
}
</style>
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
maprangsoft profile image
Maprangsoft

thank you.