react-google-recaptcha
react-google-recaptcha copied to clipboard
How to center the captcha
Hi there, I read docs but I couldn't find a way to specify styles.
Do you know how could I center the recaptcha box?
I think adding an outer div to the recaptcha component and centering might help.
<div className={style.form_group_recaptcha}>
<ReCAPTCHA
sitekey='siteKey'
onChange={onChange}
/>
</div>
In CSS file,
.form_group_recaptcha > div > div {
display: flex;
place-content: center;
}
As you can see here you have to go two times to the inner div. Hope this helps you out.
@eichgi ^ i like that example from @mshiyaf and additionally think you could center the container that you render the recaptcha in and possibly achieve what you're looking for?
If you'd like some eyes on a possible solution please create a codesandbox.io example, can even fork the example one