如何在WordPress中设置Google +1按钮的填充/边距?

时间:2012-01-29 01:11:37

标签: css wordpress padding margin google-plus-one

http://healthybodyguru.com

如果您加载网站并等待3秒钟,您会看到标题中显示attentionGrabber栏。它有添加社交按钮(FB,Twitter,G + 1)的短代码,但由于某些原因,Google +1按钮太高了。

我尝试添加自定义CSS以通过在顶部添加边距/填充来降低它,但这没有什么区别。

我可以使用什么CSS来使其与其他社交按钮对齐?

谢谢!

5 个答案:

答案 0 :(得分:3)

尝试设置:

#___plusone_0 {
    font-size: default; !important
}

使用!important覆盖内联CSS样式。

答案 1 :(得分:2)

解决方案是添加:

#attentionGrabberWrap .plusoneBtn iframe{
   margin-bottom: -3px !important;
}

我从插件创建者那里得到了帮助:)

答案 2 :(得分:1)

尝试在Google +1按钮周围放置一个span标记并填充顶部。

<span style="padding-top:5px;">[shortcode]</span>

我不知道你是否用自定义css尝试了这个,但如果没有试一试,看看会发生什么。 html中的样式标记应覆盖样式表为元素提供的任何样式。

答案 3 :(得分:0)

正如你所看到的,我喜欢div而不是跨度。当css正在玩耍时,我总是从div中获得更好的结果而不是跨度。

<div id="attentionGrabber">

  <div id="centeredPart" style="width: 575px; margin:0 auto">

    <div style="float:left;" class="facebookBtn">
      ...like code....
    </div>  

    <div style="float:left;" class="twitterBtn" >
      ...twitter code...
    </div>  

    <div style="float:left;" class="plusoneBtn">
      ...+1 code...
    </div>

    <div style="float:left;" class="linkToForums">
      Check out our new forums:
      <a class="link" href="http://healthybodyguru.com/forum/">go!</a>
    </div>

    <div style="clear:both"></div>

  </div> 

 <div id="closeAttentionGrabber"></div>


</div>

答案 4 :(得分:0)

我只是在我身后放了一封隐形字母。有点hacky但它​​对我有用。

<br><div class="g-plusone" data-annotation="none"></div><span style="font-size:33px;opacity:0;">G</span>