Create Social media icon with HTML and CSS|Social media

 Fixed Social Media Icons


 

In  This post we will write html and css code  for fixed social media icons at the right side of screen for this we need to create a new project and after that paste this HTML code in it.

     For Social media icons we use Font Awesome library. 

HTML CODE: 

<!DOCTYPE html>
<html>
<head>
<title>
Social bar
</title>
<link rel="stylesheet" type="text/css"href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> 

</head>

<body>

<div class="social-icon">

<a class="facebook" href=""><i class="fa fa-facebook"></i></a>


<a class="twitter" href=""><i class="fa fa-twitter"></i></a>

<a class="pinterest" href=""><i class="fa fa-pinterest"></i></a>

<a class="google" href=""><i class="fa fa-google"></i></a>

<a class="linkedin" href=""><i class="fa fa-linkedin"></i></a>

<a class="youtube" href=""><i class="fa fa-youtube"></i></a>


</div>

<div class="content">

<h3 style="text-align: center;">Sticky social bar </h3>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod

tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo

consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse

cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non

proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>


</div>


</body>

</html> 


CSS CODE

<style type="text/css">

.social-icon{

position: fixed;

top: 20%;

right: 0;

}

.social-icon a{

display: block;

padding: 16px;

font-size: 20px;

text-align: center;

}

.social-icon a:hover{

background-color: #509DBA;

margin-left: -15px;


}

.facebook{

background-color:#3B5998;

color: white;


}

.twitter{

background-color:#55ACEE;

color: white;


}

.google{

background-color:#dd4b39;

color: white;


}

.pinterest{

background-color:#bb0000;

color: white;


}

.linkedin{

background-color:#007bb5;

color: white;


}

.youtube{

background-color:#bb0000;

color: white;


}

.content{

margin-right: 75px;

margin-left: 15px;

font-size: 30px;


}


</style>


Post a comment

0 Comments