Home » Tip Bank » Web Development » CSS
  • Comment on this Article
Language: Web
Expertise: Intermediate
Sep 10, 2019

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Watch

Change Colors with the CSS Transition Property

Using the transition property on an element, we can do amazing CSS transitions.

See below for a example. The div will change color on hover with a transition.

HTML:

<div class="transitionColor">Hover to change color</div>

CSS:

div.transitionColor {
color: #fff;
background: #000;
transition: all 0.5s ease;
}
div.transitionColor:hover {
background: pink;
}
Srinath M S
 
Submit a Tip
Browse "Web Development" Tips
Browse All Tips
html-color-codes.info
html.net