CSS Positioning sprite - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

CSS Positioning sprite

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.profileSocial {<!--from w  w  w.j  a v  a 2 s  .  c  om-->
   width:401px;
   height:100px;
   border:2px solid Chartreuse;
   -moz-border-radius:4px;
   -webkit-border-radius:4px;
   border-radius:4px;
}

#facebook {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat scroll 0px 0px transparent;
   height:41px;
   width:181px;
   float:left;
   margin:26px 11px;
}

#facebook:hover {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat scroll 0px -41px transparent;
}

#twitter {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat scroll -181px 0px transparent;
   height:41px;
   width:181px;
   float:right;
   margin:26px 11px;
}

#twitter:hover {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat scroll -181px -41px transparent;
}
</style> 
 </head> 
 <body> 
  <div class="profileSocial"> 
   <a href="facebook.html"> 
    <div id="facebook"></div> </a> 
   <a href="twitter.html"> 
    <div id="twitter"></div> </a> 
  </div>  
 </body>
</html>

Related Tutorials