gpt4 book ai didi

css - 如何在带有上下文的 Google 登录 (GSI) 按钮上设置响应宽度

转载 作者:行者123 更新时间:2023-12-04 17:16:50 24 4
gpt4 key购买 nike

我添加了来自 https://developers.google.com/identity/gsi/web/guides/personalized-button 的“使用 Google 登录”按钮
默认样式填充整个宽度并且看起来不错:
enter image description here
但是如果你有一个帐户,它会在上下文中显示它:
enter image description here
此上下文添加 width到 iframe 内的元素样式。我知道按照规范 Google 按钮应该在 40-400px 范围内。我想制作页面容器 max-width: 400px ,但此按钮根本不会与容器一起缩放。
我是否必须使用 JavaScript 来更新 data-width属性或 CSS 有正常的解决方案吗?

  <div class="g_id_signin" data-width="400" />

最佳答案

黑客
我用过 data-width="328"并匹配容器有max-width: 328px带内边距的 328 像素可以适合 360 像素的手机屏幕(Moto G4、iPhone 6)。
正确的解决方案
等待谷歌更新他们的图书馆。不要指望它会很快发生。

关于css - 如何在带有上下文的 Google 登录 (GSI) 按钮上设置响应宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68527354/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com