dcsimg
 

Using the Hover Effect on an HTML Element

Tuesday Jan 29th 2019 by Srinath MS
Article Image

Language: Web, Expertise: Intermediate - Learn how to set the hover effect in Web pages from within CSS.

We use the hover attribute to set the hover effect in Web pages within CSS.

For example:

div {
color:#000;
}
div :hover{
color:#f00;
}

You can apply the transaction property on top of this with a time attribute in seconds. It would play a transition in the change of the color.

div :hover{
color:#f00;
transition: all 0.4s ease;
}
Home
Mobile Site | Full Site