【发布时间】:2013-08-27 13:57:56
【问题描述】:
我注意到 Google 的再营销代码在我的页面底部插入了一个 iframe。问题是 iframe 弄乱了我的布局(它的高度为 13 像素,并在底部留下一个空白的垂直空间)。
我尝试用 css 隐藏它,但它在 IE9 中仍然可见:
iframe[name='google_conversion_frame'] {
height: 0 !important;
line-height: 0 !important;
font-size: 0 !important;
}
因此我有两个问题:
a) 如何在 IE9 中隐藏这个 iframe
b) 最重要的是 - 它是否安全或会以某种方式影响此脚本的功能?
【问题讨论】:
-
可以添加试试看:
html body iframe[name=google_conversion_frame] { visibility:hidden; height:0 !important; }. -
用 display:none 替换你的 CSS,它仍然显示吗?
-
我宁愿避免弄乱可见性或显示,因为我不知道代码是否仍然有效 - 有点愚蠢,但如果有人找到任何确认的信息,请输入它作为答案并我会接受的
-
问题是我不知道,我不想被禁止。经过一段时间的挖掘,我找到了一个似乎有效的解决方案(在隐藏的 div 中插入脚本):keanrichmond.com/google-remarketing-messing-with-my-design.html@Muhammad Talha Akbar 和 Prasanna Aarthi - 你很接近所以请回答它,以便我们可以关闭这个问题
-
我会避免隐藏的 div 包装解决方法,因为 Google chrome 的标签助手扩展建议使用
Code should be placed directly above the closing <body> tag.我认为它会工作得很好,但如果它完全符合 API 则最好