页面和谷歌加一个按钮中的问题-6ren"> 页面和谷歌加一个按钮中的问题-我有一个带有以下代码的 rtl 格式的 HTML 页面,Google 加一个按钮在页面中显示效果不佳。在加载 plusone.js 文件之前,由于 html 标签中的 dir="rtl",水平滚动非常-6ren">
gpt4 book ai didi

html - 页面和谷歌加一个按钮中的问题

转载 作者:可可西里 更新时间:2023-11-01 12:52:56 24 4
gpt4 key购买 nike

我有一个带有以下代码的 rtl 格式的 HTML 页面,Google 加一个按钮在页面中显示效果不佳。在加载 plusone.js 文件之前,由于 html 标签中的 dir="rtl",水平滚动非常大。加载 plusone.js 后,滚动条将消失。我怎样才能避免这个水平滚动条的出现和消失。(我不想从标签中删除 dir="rtl")

<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl">
<head>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</head>
<body>
<div id="content">
<div class="g-plusone" data-size="small" data-annotation="none"></div>
</div>
</body>
</html>

最佳答案

我刚刚为我的网站修复了这个问题

我的问题是我站点中的每个文章页面都有一个水平滚动条。经过长时间的调查,我发现 Google 加一个按钮有一个错误此错误仅在页面使用 Direction=rtl 样式时可见。

如何修复只要错误是相关的(希望谷歌会尽快修复它)只需将其添加到您的 css 文件中

iframe[id^="oauth2relay"]
{
right:100px;
}

这将为调用“oauth2relay”(google 加一个脚本)的任何 iframe 恢复页面的正确位置

我在我的站点的每个文章页面中都使用它 - 你可以查看 - 只需在任何使用 firebug 的文章中搜索“oauth2relay”

我的网站是www.mentallica.co.il文章示例:example

关于html - <html dir ="rtl"> 页面和谷歌加一个按钮中的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7189913/

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