Add badge on top of Font Awesome symbol - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Font awesome

Description

Add badge on top of Font Awesome symbol

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="stylesheet" type="text/css" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"> 
  <style id="compiled-css" type="text/css">
.icon-wrapper {<!--from   w  ww .ja va 2s . c  om-->
   position:relative;
   float:left;
}

*.icon-blue {
   color:Chartreuse;
}

*.icon-grey {
   color:yellow;
}

i {
   width:100px;
   text-align:center;
   vertical-align:middle;
}

.badge {
   background:blue;
   width:auto;
   height:auto;
   margin:0;
   border-radius:51%;
   position:absolute;
   top:-14px;
   right:-9px;
   padding:6px;
}
</style> 
 </head> 
 <body> 
  <div class="icon-wrapper"> 
   <i class="fa fa-envelope fa-5x fa-border icon-grey"></i> 
   <span class="badge">Lor</span> 
  </div>  
 </body>
</html>

Related Tutorials