So I am trying to position the facebook / youtube / twitter button on a div element with a width of 318 pixels (i.e. about 106 pixels per button).
Expected output

(source: iforce.co.nz )
I use float and display: inline for each button when rendering it. I have provided my code below.
CSS code
#socialController{
width: 318px;
background-color:#fff;
display: inline;
}
.socialmedia
{
width:106px;
height:20px;
float:left;
vertical-align:middle;
background-position:center center;
background-repeat:no-repeat;
background-color:#373737;
}
.socialmedia:hover{
background-color:#444
}
#sm_fb{
background-image:url(../img/fb.png)
}
#sm_tw{
background-image:url(../img/tw.png)
}
#sm_yt{
background-image:url(../img/yt.png)
}
HTML code
<div id="socialController">
<a href="#" class="socialmedia" id="sm_fb" title="CSGONZ Facebook"></a>
<a href="#" class="socialmedia" id="sm_yt" title="CSGONZ Youtube"></a>
<a href="#" class="socialmedia" id="sm_tw" title="CSGONZ Twitter"></a>
</div>
But the problem is that I do not achieve the expected horizontal positioning ... but instead I get the vertical positioning of the buttons.
Actual result

(source: iforce.co.nz )
What is the problem? What am I missing? achieve horizontal positioning?
source
share