css on hover code example
Example 1: css hover animation
.YOURHTMLCONTENT i {
height: auto;
float: left;
color: #fff;
font-size: 55px;
margin: 30px 30px 30px 30px;
transition: 0.8s;
transition-property: color, transform;
}
.YOURHTMLCONTENT i:hover {
color: #FF5733;
transform: scale(1.3);
}
Example 2: css hover
.a:hover{background-color: black;}
Example 3: on hover css
/* Changes an element's color on hover */
.selector {
background-color: black;
}
.selector:hover {
background-color: blue;
}
Example 4: hover style html
/* css file */
.callitwhatever:hover
{
background: none;
}
/* HTMl File */
<li><a href="#" class="callitwhatever"> Logo</a></li>
Example 5: 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>
</body>
</html>
Example 6: 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;
}