谷歌登录按钮的宽度和高度问题
Google signin button width and height issue
我正在尝试在我的一个应用程序中使用谷歌登录按钮。我在Chrome上得到了这个工作fonr。但是,当我尝试在Firefox和IE中包含此按钮的页面时,该按钮从未出现,并且在进一步的故障排除中,我注意到高度,宽度和其他参数设置为" 1px"。我已经复制了下面生成的 HTML。有什么线索吗?
<div id="___signin_0" style="text-indent: 0px; margin: 0px; padding: 0px; background: none repeat scroll 0% 0% transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline; display: inline-block; width: 1px; position: relative; height: 1px;"><button style="opacity: 0; z-index: 10000; left: 0px; top: 0px; position: absolute; cursor: pointer; outline: 0px none; width: 1px; height: 1px;">Sign in with Google</button><iframe title="Sign in with Google" data-gapiattached="true" src="https://apis.google.com/_/widget/render/signin?usegapi=1&type=red&scope=profile%20email&width=standard&height=standard&cookiepolicy=single_host_origin&clientid=xxxxxxxx.com&origin=http%3A%2F%2Flocalhost%3A2098&url=http%3A%2F%2Flocalhost%3A2098%2F&gsrc=3p&ic=1&jsh=m%g#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I0_12343&parent=http%3A%2F%2Flocalhost%3A2098&pfname=&rpctoken=42643494" name="I0_1234455" id="I0_1234455" vspace="0" tabindex="0" style="position: static; top: 0px; width: 1px; margin: 0px; border-style: none; left: 0px; visibility: visible; height: 1px;" scrolling="no" marginwidth="0" marginheight="0" hspace="0" frameborder="0" width="100%"></iframe></div>
编辑:我的呈现按钮的代码如下所示:
<span id="signinButton" style="display:block">
<span
class="g-signin"
data-callback="signinCallback"
data-clientid="xxxxxxxxxxxxxxxx.com"
data-cookiepolicy="single_host_origin"
data-height="standard"
data-width="standard"
data-scope="profile email">
</span>
</span>
我已经做了很多搜索来做到这一点,但是,我认为谷歌的iframe根本无法改变。您可以设置最小宽度,但不能更改宽度本身,也不能更改最大值(默认为 400)。高度根本无法更改。遗憾的是,他们正在删除旧的javascript按钮(可能是因为人们进行了很多错误的配置?),他们真的需要使样式完全可定制。如果有人有解决方案,也让我知道,但我可以在大量搜索和阅读他们的文档后说这是不可能的(还)
Google
不允许人们更改他们的徽标或样式,这就是为什么您提供的任何样式都会被 Google 脚本覆盖的原因我认为这个网址可能会有所帮助https://developers.google.com/identity/sign-in/web/build-button
当我
发现登录按钮的data-width
属性可以设置为数字而不是standard
时,我正在查看Google的代码生成器。下面是一个代码示例:
<span id="signinButton" style="display:block">
<span
class="g-signin"
data-callback="signinCallback"
data-clientid="xxxxxxxxxxxxxxxx.com"
data-cookiepolicy="single_host_origin"
data-height="standard"
data-width="400"
data-scope="profile email">
</span>
</span>
我注意到你使用了<span>
标签,而在我的情况下,我使用了<div>
s。
相关文章:
- Javascript高度问题
- 活动菜单 部分高度问题
- 谷歌登录按钮的宽度和高度问题
- 适合页面.高度问题
- jquery循环滑块高度问题
- 当内容显示在FireFox的iFrame中时,jQuery高度问题
- DHTMLX 移动调度程序事件详细信息视图高度问题
- 安卓平板电脑上的单页网页应用程序高度问题
- 纸材料聚合物中的高度问题
- 幻灯片自动高度问题
- 引导模态元素的高度问题
- 使用 ajax (MVC) 的 JQuery UI 可折叠高度问题
- 砌体/动态幻灯片高度问题
- 滚动窗格高度问题
- 完整日历高度问题
- jQuery跨域Iframe高度问题
- 结合jQuery对话框和选项卡时的高度问题
- 手风琴高度问题
- KineticJS的图像宽度和高度问题
- JQuery手风琴高度问题