开发者

Giving the Facebook like button a variable width?

开发者 https://www.devze.com 2023-04-12 12:59 出处:网络
I\'d like to right align the Facebook like button, so that regardless of whether 0 or 10,000,000 people have liked it it lines up with the right side of the page.Is this possible??I\'ve looked everywh

I'd like to right align the Facebook like button, so that regardless of whether 0 or 10,000,000 people have liked it it lines up with the right side of the page. Is this possible?? I've looked everywhere to no avail.

Thanks for helping!

This is what we're looking to do, but right now we have to set a fixed width on the li开发者_如何学编程ke button, so if the like count is 1 - the page isn't aligned properly, or if the like count is 250 the page isn't aligned properly.

Giving the Facebook like button a variable width?


You can wrap the facebook button inside a div, and set the div overflow hidden, just to make sure that it wont exceed the fixed width.

.mybutton{
    width:50px;
    overflow:hidden;
}

You can see this jsfiddle.

http://jsfiddle.net/62sCG/1/

0

精彩评论

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

关注公众号