css hover transition code example
Example 1: css transition opacity
.myClass {
vertical-align: top;
transition: opacity 0.3s;
-webkit-transition: opacity 0.3s;
opacity: 1;
}
.myClass:hover {
opacity: 0.5;
}
Example 2: transition transform
.section:hover {
transform: translateX(0px) translateY(75px);
}
.section {
transition: transform 500ms ease-in-out 25ms;
}
Example 3: 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 4: css transition on hover
div {
color: white;
background-color: black;
}
div:hover {
background-color: red;
}
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;
}
Example 5: hover effect
.entry h2{
font-size:36px;
color:#000;
font-weight:800;
}
.entry h2:hover{
color:#f00;
}
Example 6: transition syntax css
transition: property duration transition-timing-function delay;