Given the recent changes to the component component of the fb-login-button component (which, like weeks or so, it ALWAYS rewrites custom text into “Login”), it’s best to create your own CSS class for Facebook and run FB.Login through Javascript. This is what I did, and it works well.
Here is some CSS for a Facebook button that looks exactly like a standard Facebook button and easily supports custom text:
a.fb-button { color: #FFF; display: inline-block; text-decoration: none; } .fb-button { background: #5F78AB; background-image: url('http://static.ak.fbcdn.net/rsrc.php/v2/yf/r/S-DbSHszr4D.png'); background-repeat: no-repeat; background-position: -1px -81px; border-top: 1px solid #29447E; border-right: 1px solid #29447E; border-bottom: 1px solid #1A356E; border-left: 1px solid #29447E; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), inset 0 1px 0 #8A9CC2; -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), inset 0 1px 0 #8a9cc2; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), inset 0 1px 0 #8A9CC2; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; font-weight: bold; height: 23px; line-height: 23px; padding: 0px 5px 0px 30px; text-align: left; }
The item on your page will be
<a class="fb-button" onClick="fblogin();">Custom Text</a>
And then the JS function is like this
var fblogin = function() { FB.login(function(response) { if (response) { if (response.authResponse) {
Of course, you need to include the fb root div on your page and run the Facebook SDK before that
Here's what it looks like:
The great thing about CSS is that you can use it to create other Facebook buttons on your site for things that are not supported (like Share) with a familiar look. You can even create additional css to use buttons of different sizes. You just need to have different background positions for the background image and different font sizes, heights, etc.