49 lines
963 B
HTML
49 lines
963 B
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<style>
|
||
|
body {
|
||
|
margin: 0;
|
||
|
overflow: hidden;
|
||
|
}
|
||
|
|
||
|
.hover-trigger {
|
||
|
position: relative;
|
||
|
display: inline-block;
|
||
|
padding: 20px;
|
||
|
font-size: 18px;
|
||
|
cursor: pointer;
|
||
|
}
|
||
|
|
||
|
.hover-trigger:hover::before {
|
||
|
content: '';
|
||
|
position: absolute;
|
||
|
top: 50%;
|
||
|
left: 0;
|
||
|
width: 100%;
|
||
|
height: 2px;
|
||
|
background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet); /* Change colors as needed */
|
||
|
animation: drawLine 2s ease-in-out;
|
||
|
}
|
||
|
|
||
|
@keyframes drawLine {
|
||
|
0% {
|
||
|
width: 0;
|
||
|
left: 50%;
|
||
|
}
|
||
|
100% {
|
||
|
width: 100%;
|
||
|
left: 0;
|
||
|
}
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<div class="hover-trigger">Hover me</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|