css3 - need css trick to solve this issue -
hi guys i'm working on website orange background. i'm using white social icons font awesome library.
here result of work
css
@import url('http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css'); @import url('http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font- awesome.min.css'); body { margin: 10px; background:#da4a10; } #social:hover { -webkit-transform:scale(1.1); -moz-transform:scale(1.1); -o-transform:scale(1.1); } #social { -webkit-transform:scale(0.8); /* browser variations: */ -moz-transform:scale(0.8); -o-transform:scale(0.8); -webkit-transition-duration: 0.5s; -moz-transition-duration: 0.5s; -o-transition-duration: 0.5s; } .fa-3x{ color: white; } .social-fb:hover { color: #3b5998; } .social-tw:hover { color: #4099ff; } .social-gp:hover { color: #d34836; } .social-em:hover { color: #f39c12; }
html
<div id="row"> <div class="col-xs-2 col-sm-8 col-lg-2 col-md-6"> <a href="#"> <i id="social" class="fa fa-facebook-square fa-3x social-fb"></i> </a> </div> <div class="col-xs-2 col-sm-8 col-lg-2 col-md-6"> <a href="#"> <i id="social" class="fa fa-twitter-square fa-3x social-tw"></i> </a> </div> <div class="col-xs-2 col-sm-8 col-lg-2 col-md-6"> <a href="#"> <i id="social" class="fa fa-google-plus-square fa-3x social-gp"></i> </a> </div> <div class="col-xs-2 col-sm-8 col-lg-2 col-md-6 "> <a href="#"> <i id="social" class="fa fa-envelope-square fa-3x social-em"></i> </a> </div> </div>
http://jsfiddle.net/dtchh/5582/
i need solution because when hover on social icons, of not nice. tried adding white background icons it's still not functioning properly.
since using font awesome, there icon available called: fa-square
. has exact shape of square social media icons. also, font awesome has opportunity stack icons. if stack fa-square
under fa-twitter-square
e.g. , make fa-square
white, solve problem.
html
<div id="row"> <div class="col-xs-2 col-sm-8 col-lg-2 col-md-6"> <a href="#"> <span class="fa-stack fa-2x social social-fb"> <i class="fa fa-square fa-stack-1x white-bg"></i> <i class="fa fa-facebook-square fa-stack-2x "></i> </span> </a> </div> <div class="col-xs-2 col-sm-8 col-lg-2 col-md-6"> <a href="#"> <span class="fa-stack fa-2x social social-tw"> <i class="fa fa-square fa-stack-1x white-bg"></i> <i class="fa fa-twitter-square fa-stack-2x "></i> </span> </a> </div> <div class="col-xs-2 col-sm-8 col-lg-2 col-md-6"> <a href="#"> <span class="fa-stack fa-2x social social-gp"> <i class="fa fa-square fa-stack-1x white-bg"></i> <i class="fa fa-google-plus-square fa-stack-2x "></i> </span> </a> </div> <div class="col-xs-2 col-sm-8 col-lg-2 col-md-6 "> <a href="#"> <span class="fa-stack fa-2x social social-em"> <i class="fa fa-square fa-stack-1x white-bg"></i> <i class="fa fa-envelope-square fa-stack-2x "></i> </span> </a> </div> </div>
css
/* optional theme */ @import url('http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css'); @import url('http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'); body { background: #da4a10; margin: 10px; } .social { color: #f9f9f9; transition: 0.5s; -moz-transition: 0.5s; -ms-transition: 0.5s; -o-transition: 0.5s; -webkit-transition: 0.5s; } /* definition of white background */ .white-bg { color: white; font-size: 54px; opacity: 0; transition: 0.5s; -moz-transition: 0.5s; -ms-transition: 0.5s; -o-transition: 0.5s; -webkit-transition: 0.5s; } .social-fb:hover{ color: #3b5998; } .social-tw:hover { color: #4099ff; } .social-gp:hover { color: #d34836; } .social-em:hover { color: #f39c12; } /* show white background on hover */ .social-fb:hover .white-bg, .social-tw:hover .white-bg, .social-gp:hover .white-bg, .social-em:hover .white-bg { opacity: 1; }
solution in action: http://jsfiddle.net/dtchh/6084/
Comments
Post a Comment