How to center Google reCaptcha?

Asked

Viewed 1,002 times

1

I have a reCaptcha in my form, but I’m not able to center it or leave it in the same size as the fields.

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-10 col-sm-offset-1">
            <div class="col-sm-6">
                 ...
            </div>
            <div class="col-sm-6">
                <form accept-charset="UTF-8" method="post" action="">
                    ...
                    <div class="form-group">
                        <label>Cargo*:</label>
                        <input type="text" class="form-control input-lg" required>
                    </div>
                    <div class="form-group">
                        <div class="g-recaptcha" data-sitekey="minha_key"></div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

inserir a descrição da imagem aqui

How can I fix this?

  • Are you using bootstrap? Put a little more of your HTML there to make it easier to understand.

  • I am @Ricardo. I put another piece of code.

1 answer

2


Recaptcha div is a display block, to center vc adds a width in div and a margin: auto.

.g-recaptcha {
  width: 302px;
  margin: auto;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.