CSS Mouse Out Transition Effect | Css Hover Transition
Welcome🎉 to Code With Random blog. In this blog, we learn how to create a CSS Mouse Out Transition Effect. We use HTML & CSS for CSS Mouse Out Transition Effect. Hope you enjoy our blog so let’s start with a basic HTML structure for the CSS Mouse Out Transition Effect.
HTML code
<h1>Hover Me</h1>
There is all HTML code for the CSS Mouse Out Transition Effect. Now, you can see output without CSS, then we write CSS for the CSS Mouse Out Transition Effect.
h1::before {
transform: scaleX(0);
transform-origin: bottom right;
}
h1:hover::before {
transform: scaleX(1);
transform-origin: bottom left;
}
h1::before {
content: " ";
display: block;
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
inset: 0 0 0 0;
background: hsl(200 100% 80%);
z-index: -1;
transition: transform .3s ease;
}
h1 {
position: relative;
font-size: 5rem;
}
html {
block-size: 100%;
inline-size: 100%;
}
body {
min-block-size: 100%;
min-inline-size: 100%;
margin: 0;
box-sizing: border-box;
display: grid;
place-content: center;
font-family: system-ui, sans-serif;
}
@media (orientation: landscape) {
body {
grid-auto-flow: column;
}
}