Skip to content

Commit 7e47f5e

Browse files
authored
Merge pull request #57 from prat1k-gupta/prat1k
added the text hover effect #54
2 parents 712d581 + 520daf7 commit 7e47f5e

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

CSS text hover effect/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Multicolor underline hover effect
2+
3+
![image](https://user-images.githubusercontent.com/92115707/196000815-8f2a291c-ae81-45c5-97a5-d948050ce664.png)
4+
5+
A cool multicolor underline hover effect
6+
7+
Use it to highlight important term or quote.
8+

CSS text hover effect/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="stylesheet" href="style.css">
8+
<title>hover effect</title>
9+
</head>
10+
<body>
11+
<div class="container">
12+
<p>
13+
There were a variety of ways to win the game. <a href="#" class="effect">James had played it long enough to know most of them</a> and he could see what his opponent was trying to do. There was a simple counterattack that James could use and the game should be his.
14+
</p>
15+
</div>
16+
</body>
17+
</html>

CSS text hover effect/style.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
body{
2+
background-color: #0093E9;
3+
background-image: linear-gradient(160deg, #0093E9 0%, #80D0C7 100%);
4+
margin: 0;
5+
height: 100vh;
6+
overflow: hidden;
7+
font-family: 'Monsterrat',sans-serif;
8+
}
9+
.container{
10+
padding: 7px;
11+
margin: 240px auto;
12+
width: 70%;
13+
border: 2px solid white;
14+
border-radius: 5px;
15+
}
16+
p{
17+
color: white;
18+
text-align: center;
19+
line-height: 1.5;
20+
}
21+
.effect{
22+
background-image: linear-gradient(90deg,red,blue);
23+
background-size: 0% 4px;
24+
background-repeat: no-repeat;
25+
background-position: left bottom;
26+
text-decoration: none;
27+
font-weight: bold;
28+
color: white;
29+
transition: background-size 300ms linear;
30+
}
31+
.effect:hover{
32+
background-size: 100% 4px;
33+
}

0 commit comments

Comments
 (0)