Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background Color Hover Fade Effect CSS

First, I am a beginner. I want a step by step instruction.

I want to add a smooth background hover effect to my links in Wordpress

a {   color:#000;} a:hover {   background-color: #d1d1d1; color:#fff; } 

I want the hover on links slow, instead of instant. Do I need any JavaScript or jQuery ? If so, please tell me how to do that.

like image 292
anupal Avatar asked Aug 09 '11 10:08

anupal


People also ask

How do I use WebKit transition in CSS?

Use the @supports (transition) feature query instead. The -webkit-transition Boolean non-standardCSS media feature is a WebKit extension whose value is true if the browsing context supports CSS transitions. Apple has a description in Safari CSS Reference; this is now called transition there.

How do I slow down hover in CSS?

To set the speed of the hover, use the transition-duration property. To set the hover, use the :hover selector.

How do you make a fade in CSS?

In the CSS, use the @keyframes rule paired with fadeIn. At 0%, set the opacity to 0. At 100%, set the opacity to 1. This creates the fade-in effect.


Video Answer


1 Answers

Since this is a cosmetic effect, it shouldn't be too vital that this fires. Given that, you might want to look at CSS 3 transformations.

a {    color: #000;    transition: background 0.5s linear;  }  a:hover {    background-color: #d1d1d1;    color: #fff;  }
<a href="http://example.com">Hover me</a>
like image 183
Quentin Avatar answered Sep 22 '22 21:09

Quentin