css text hover effects code example

Example 1: css hover

.a:hover{background-color: black;}

Example 2: on hover css

/* Changes an element's color on hover */

.selector {
	background-color: black;
}

.selector:hover {
	background-color: blue;
}

Example 3: how to chane text color when hover in css

CSS
.link { color: #FF0000; } /* CSS link color (red) */
.link:hover { color: #00FF00; } /* CSS link hover (green) */

Example 4: css hover animation text

a {
  /* Same as before */
  background: linear-gradient(to right, midnightblue, midnightblue 50%, royalblue 50%);
}

Example 5: css hover animation text

a {
  /* Same as before */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
  background-position: 100%;
}

Tags:

Css Example