Social Buttons library is a set of CSS Buttons made in pure CSS and are based on Bootstrap and Font Awesome.
To load the bootstrap-social.css library, download the bootstrap-social.css from github and paste the following line in the <head> section of the webpage.
<head> <link rel = "stylesheet" href = "bootstrap-social.css"> </head>
Create a button using html anchor tag and add styles btn, btn-block with social specifier btn-social.
<html> <head> <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel = "stylesheet" href = "http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <link rel = "stylesheet" href = "/css_buttons/bootstrap-social.css"> </head> <body> <a class = "btn btn-block btn-social btn-twitter"> <span class = "fa fa-twitter"></span> Login with Twitter </a> </body> </html>
It will produce the following output −
You can increase or decrease the size of an button by defining its size using CSS and using it along with the class name, as shown below. In the given example, we have changes four sizes.
<html> <head> <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel = "stylesheet" href = "http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <link rel = "stylesheet" href = "/css_buttons/bootstrap-social.css"> </head> <body> <a class = "btn btn-block btn-lg btn-social btn-twitter"> <span class = "fa fa-twitter"></span> Login with Twitter </a> <a class = "btn btn-block btn-md btn-social btn-twitter"> <span class = "fa fa-twitter"></span> Login with Twitter </a> <a class = "btn btn-block btn-sm btn-social btn-twitter"> <span class = "fa fa-twitter"></span> Login with Twitter </a> <a class = "btn btn-block btn-xs btn-social btn-twitter"> <span class = "fa fa-twitter"></span> Login with Twitter </a> </body> </html>
It will produce the following output −
The following example shows how to choose icon only buttons.
<html> <head> <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel = "stylesheet" href = "http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <link rel = "stylesheet" href = "bootstrap-social.css"> </head> <body> <a class = "btn btn-social-icon btn-twitter"> <span class = "fa fa-twitter"></span> </a> </body> </html>
It will produce the following output −