调整谷歌的宽度加上1个按钮

ton*_*ega 14 google-plus-one

我想弄清楚如何修改Google plus 1按钮的宽度......

在文档中,它说你可以设置宽度.

目前,当我使用Firebug检查元素时...它表示宽度设置为90px,我想将其设置为70px ......这可能吗?

    <!-- Place this tag where you want the +1 button to render -->
    <g:plusone size="medium"></g:plusone>

    <!-- Place this render call where appropriate -->
    <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>
Run Code Online (Sandbox Code Playgroud)

Kyl*_*cey 17

如果您使用多个按钮,ID并不总是相同,因此您可以使用此位的CSS来捕获多个按钮:

[id^=___plusone] { width:72px !important; }
Run Code Online (Sandbox Code Playgroud)

这适用于所有具有Id开头的元素___plusone,这似乎是Google按钮的命名空间


Car*_*ria 12

不知道iframe id是否总是相同但如果是,你可以使用css +!important来覆盖元素样式.就像是:

/* this overrides 90px to 72px width to +1 button */
#___plusone_0{ width:72px !important; }
Run Code Online (Sandbox Code Playgroud)

希望能帮助到你.


cee*_*yoz 2

您可以在代码生成器中选择几个高度设置,但不能选择任意大小值。