Crazy Text Fill Effect On Hover Html & Css
Learn How To Create Crazy Text Fill Effect On Hover Using Html & Css With Step - by - Step
Html Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>text fill effect</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="fill" data-fill="Mohamed">Mohamed</div>
<script src="control.js"></script>
</body>
</html>
Css Code
:root {
--main-color: rgb(255 255 255/80%);
}
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
.fill {
font-size: 120px;
font-weight: bold;
margin: 20px auto;
text-align: center;
-webkit-text-fill-color: white;
-webkit-text-stroke: 2px #333;
position: relative;
width: fit-content;
}
.fill::before {
content: attr(data-fill);
position: absolute;
top: 0;
left: 0;
font-weight: bold;
-webkit-text-fill-color: #ff5722;
transition: 0.5s;
width: 0%;
overflow: hidden;
}
.fill:hover::before {
width: 100%;
}
Then Hover Over The Text To See The Gradient Fill Effect In Action
