Check out example codes for "on hover css". It will help you in understanding the concepts better.

Code Example 1

/* Simple CSS color transition effect on selector */

div {
	color: white;
  	background-color: black; 
}

div:hover {
	background-color: red;
}


/* Additional transition effects on selector */

div {
	background-color: black;
  	color: white;
  	height: 100px;
  	transition: width 1.5s, height 3s;
  	width: 100px;
  	
}

div:hover {
	background-color: red;
  	height: 300px;	
  	width: 150px;
}

Code Example 2

a:hover{ 
	background-color: yellow;
}

Code Example 3

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

.selector {
	background-color: black;
}

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

Code Example 4

a:hover
 { 

   background-color: yellow;

 }

Code Example 5

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

Code Example 6

/* unvisited link */
a:link {
  color: green;
}

 
/* visited link */

 a:visited {
  color: green;
}

/* mouse over link */

 a:hover {
  color: red;
}

/* selected link */

 a:active {
  color: yellow;
}

Learn ReactJs, React Native from akashmittal.com