开发者

Changing The Size of Twitter's Follow Button?

开发者 https://www.devze.com 2023-03-09 20:05 出处:网络
I\'m looking at the new Twitter Follow Button (https://twitter.com/about/resources/followbutton), but unfortunately my sidebar is smaller than the default size, thus throwing my whole site out of whac

I'm looking at the new Twitter Follow Button (https://twitter.com/about/resources/followbutton), but unfortunately my sidebar is smaller than the default size, thus throwing my whole site out of whack.

Is there an easy way to hack the script to resize the button, or at least to put a line break between the actual follow button and the account 开发者_开发技巧name?


If you look at the page source, then your twitter code converts from

<div class="twitter">
  <!-- twitter code here -->
</div>

to

<div class="twitter">
  <iframe ...>...</iframe>
</div>

Now it's easy to change the width of the button via css:

.twitter iframe {
  width: 80px !important;
}


I'd wrap the button in a container with a nice class name and use CSS to adjust the styling.

.twitter-button-container{
  width: 100px;
  height:100px;
}

Something like that.

UPDATE

On second thought, it seems that the image is a background image to the anchor tag. I don't think it's possible to resize background images using CSS etc. You'd need to have the image in an img tag.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号