Responsive Social Share Buttons

Earlier we saw about responsive web design for designing a login form that adapts various screen sizes. In this tutorial, we are going to see how to adapt responsive social share buttons for various device viewport. If you like to know about what is responsive design, refer this tutorial.

In this example, we are showing either social share icons or text buttons based on the media screen width. We are also managing the position of the buttons to different locations on the device screen.

HTML Code with Responsive Share Buttons

The HTML code containing group of social share button is,

<html>
<head>
<TITLE>Responsive Social Share Buttons</TITLE>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Responsive Social Share Buttons</h1>
<div id="share-box">
<div class="btnShare btnFacebook"><img src="facebook.png" class="icon-share"><span class="txt-share">Facebook</span></div>
<div class="btnShare btnTwitter"><img src="twitter.png" class="icon-share"><span class="txt-share">Twitter</span></div>
<div class="btnShare btnGoogle"><img src="google-plus.png" class="icon-share"><span class="txt-share">Google</span></div>
</div>
<div class="txt-content">
<p>Few days before we have seen about responsive web design for designing a login form that adapts various screen sizes. In this tutorial, we are going to adapt responsive social share buttons for various device view port.</p>
<p>In this example we are showing either social share icons or text based on the media screen width. We are also managing position of the buttons to be adapted within the device screen.</p>
<p>The HTML code will contain group of social share icons in a DIV container. This container's position is controlled by the style sheet with various device screen by using medial queries.</p>
</div>
</body>
</html>

CSS for Responsive Share Buttons

This style sheet contains media queries to manage the social share button positions by using CSS position and float properties.