<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
iniyial-scale=1.0">
<title>CSS TEXT HOVER EFFECTS</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<ul>
<li > India </li>
<li>Ukraine</li>
<li>Russia</li>
</ul>
</body>
</html>
*
{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'poppins',sans-serif;
}
body
{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #333;
}
ul
{
position: relative;
display: flex;
flex-direction: column;
gap: 10px;
}
ul li
{
list-style: none;
align-items: center;
color: #333;
font-size: 4em;
font-weight: 710;
cursor: pointer;
transition: 0.5s;
padding: 5px 20px;
border-radius: 10px;
}
ul:hover li
{
color:transparent;
-webkit-text-stroke: 1px #000;
}
ul li:hover
{
color: #333;
background: #fff;
box-shadow: 0 5px 15px rgba(0,0,0,0,0.76);
}
ul li::before
{
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 100vw;
height: 100vh;
background: #f00;
z-index: -1;
display: flex;
align-items: center;
opacity: 0;
transition: 0.5s;
}
ul li:hover::before
{
opacity: 1;
}
ul li:nth-child(1)::before
{
background: linear-gradient(#ff9a33 0%,#ff9a33 33%,
#fff 33%,#fff 66%,#138807 66%,#138807 100%);
}
ul li:nth-child(2)::before
{
background: linear-gradient(#005bbc 0%,#005bbc 50%,
#ffd600 50%,#ffd600 100%);
}
ul li:nth-child(3)::before
{
background: linear-gradient(#fff 0%,#fff 33%,
#0039a6 33%,#0039a6 66%,#d52b1e 66%,#d52b1e 100%);
}
0 Comments
If your having doubt please let me know