html - Fade Background but NOT Text -


i have applied css fade in/out solution div, im happy with, part. want apply background, not text. need text opaque @ times.

see example: http://jsfiddle.net/howiepaul/guapv/33/

a.tab {background-color:#d4d4d4; font-family: arial; font-weight: bold;}  a.tab:hover { opacity:1; animation: tickhov 1.5s; -moz-animation: tickhov 1.5s; /* firefox */ -webkit-animation: tickhov 1.5s; /* safari , chrome */} @-ms-keyframes tickhov {from {opacity:0.2;} {opacity:1;}} @-moz-keyframes tickhov /* firefox */ {from {opacity:0.2;} {opacity:1;}} @-webkit-keyframes tickhov /* safari , chrome */ {from {opacity:0.2;} {opacity:1;}}  a.tab{ opacity:0.2; animation: letgo 1.5s; -moz-animation: letgo 1.5s; /* firefox */ -webkit-animation: letgo 1.5s; /* safari , chrome */} @-ms-keyframes letgo {from {opacity:1;} {opacity:0.2; visibility: hidden; display: none;}} @-moz-keyframes letgo /* firefox */ {from {opacity:1;} {opacity:0.2; visibility: hidden; display: none;}} @-webkit-keyframes letgo /* safari , chrome */ {from {opacity:1;} {opacity:0.2; visibility: hidden; display: none;}} 

any gratefully received.

many howie

you should animating on background-color not opacity. fyi if you're doing should use transitions instead of animations, they're simpler.

jsfiddle

a.tab {     position:relative;     font-family: arial;     font-weight: bold;     background-color:rgba(212,212,212,.2);     -moz-transition:background-color 1.5s ease;     -webkit-transition:background-color 1.5s ease;     transition:background-color 1.5s ease; }  a.tab:hover {     background-color:rgba(212,212,212,1); } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -