【发布时间】:2011-11-19 19:22:00
【问题描述】:
我在https://developers.google.com/+/plugins/badge/config上配置标准徽章
为它 Google+ 渲染 iframe 内容。 如何在 iframe 中更改类样式?
【问题讨论】:
标签: google-plus google-plus-one badge
我在https://developers.google.com/+/plugins/badge/config上配置标准徽章
为它 Google+ 渲染 iframe 内容。 如何在 iframe 中更改类样式?
【问题讨论】:
标签: google-plus google-plus-one badge
目前似乎没有办法做到这一点。我尝试编辑 CSS 以摆脱烦人的边框和白色背景:
.yeb {
background-color: none !important;
border: 0px solid gainsboro !important;
}
但由于 CSS 位于 Google 服务器中,因此您无法覆盖 iFrame。它是 Google 论坛中的当前feature request。
【讨论】:
你可以做一个小技巧:
iframe 的 HTML:
<div id="social_gplus_circle">
<div id="social_gplus_circle_inner"><g:plus href="https://plus.google.com/105379671042990608528" size="smallbadge"></g:plus></div>
</div>
诀窍的 CSS:
#social_gplus_circle{overflow: hidden;width: 105px;height: 45px;padding-top: 7px;}
#social_gplus_circle_inner{overflow: hidden;position: relative;top: -20px;left: -130px;height: 50px;width: 276px;}
iframe{display: block!important;}
这不是我自己做的,我是从谷歌论坛得到的。
【讨论】:
您无法更改它,因为 google plus 代码不在您的服务器上。 如果您的页面和 iframe 代码在同一台服务器上,您只能修改 iframe CSS 。
【讨论】: