reCAPTCHA框未正确对齐 [英] reCAPTCHA box not being aligned correctly

查看:112
本文介绍了reCAPTCHA框未正确对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在我的注册页面上正确对齐reCAPTCHA表单。即使 div 包含在 text-align 设置为 center ,它显示在页面的左侧:


如果我通过JavaScript更改它的 align document.getElementById(recaptcha_widget_div)。align = right)它可以正常工作(截图在页面中间):



我做错了什么?



编辑:这里是一个小提琴,在页面中调用了整个CSS。

解决方案

我发布了针对此问题的更新解决方案,因为接受的解决方案不适用于Google ReCaptcha的新版本2.0。 / p>

正确的格式是:

  .g-recaptcha div {margin-left:auto; margin-right:auto;} 

新的ReCaptcha使用一个 div 类,称为 g-recaptcha 以及一些未识别和未分类的 div 子元素。这可能是使窗口小部件正确居中的最干净最安全的方式。


I can't get to align correctly the reCAPTCHA form on my registration page. Even if the div it is contained in has text-align set to center, it is displayed on the left of the page:
While if I change its align via JavaScript (document.getElementById("recaptcha_widget_div").align = "right") it works correctly (screenshot taken in the middle of the page):

What am I doing wrong?

Edit: here's a fiddle with the div and the entire CSS called in the page.

解决方案

I'm posting an updated solution to this question, as the accepted solution does not work with the new version 2.0 of Google's ReCaptcha.

Correct formatting is:

.g-recaptcha div { margin-left: auto; margin-right: auto;}

The new ReCaptcha uses a single div class called g-recaptcha and a number of unidentified and unclassified div children. This is probably the cleanest safest way to get the widget to center properly.

这篇关于reCAPTCHA框未正确对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆