Answers for "on hover css"

CSS
25

on hover css

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

.selector {
	background-color: black;
}

.selector:hover {
	background-color: blue;
}
Posted by: Guest on February-15-2020
21

css hover

.a:hover{background-color: black;}
Posted by: Guest on February-20-2020
1

hover css

<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8" />
      <title>CSS :hover property</title>

      <style>
         a {
            background-color: powderblue;
            transition: background-color 0.5s;
         }

         a:hover {
            background-color: gold;
         }
      </style>
   </head>
   <body>

	<a href="#">Try hovering over this link.</a>

	<!-- The :hover CSS pseudo-class matches when the user interacts
	with an element with a pointing device, but does not necessarily activate
	it. It is generally triggered when the user hovers over an element with
	the cursor (mouse pointer). -->

   </body>
</html>
Posted by: Guest on February-24-2021
2

css transition on hover

/* 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;
}
Posted by: Guest on May-13-2020
0

hover in html

//Select and style a link when you mouse over it:
  
    a:hover
 { 

   background-color: yellow;

 }
Posted by: Guest on May-28-2021
0

css hover

.my-div:hover{
  background-color: #f00; /*RED*/
}
/*When mouse come over .my-div the background-color will be changed to red*/
Posted by: Guest on June-14-2021

Browse Popular Code Answers by Language