-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathhover.html
More file actions
126 lines (119 loc) · 2.9 KB
/
hover.html
File metadata and controls
126 lines (119 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hover effect</title>
<style>
.main {
display: flex;
}
p {
border: 2px solid grey;
height: 2em;
width: auto;
margin: 1em;
padding: 1em;
}
.text-color {
color: black;
}
.text-color:hover {
color: brown;
}
.text-size:hover {
font-size: larger;
}
.text-rotate:hover {
transform: rotate(20deg);
}
.text-bg:hover {
background: #000;
color: antiquewhite;
}
.text-animate{
box-shadow: inset 0 0 0 0 #54b3d6;
color: #54b3d6;
margin: 0 -.25rem;
padding: 0 .25rem;
transition: color .3s ease-in-out, box-shadow .3s ease-in-out;
}
.text-animate:hover{
box-shadow: inset 100px 0 0 0 #54b3d6;
color: white;
}
.button {
background-color: black;
color: aqua;
padding: 10px;
font: large;
cursor: pointer;
}
.text-animate2 {
overflow: hidden;
position: relative;
display: inline-block;
}
.text-animate2::before,
.text-animate2::after {
content: '';
position: absolute;
width: 100%;
left: 0;
}
.text-animate2::before {
background-color: #54b3d6;
height: 2px;
bottom: 0;
transform-origin: 100% 50%;
transform: scaleX(0);
transition: transform .3s cubic-bezier(0.76, 0, 0.24, 1);
}
.text-animate2::after {
content: attr(data-replace);
height: 100%;
top: 0;
transform-origin: 100% 50%;
transform: translate3d(200%, 0, 0);
transition: transform .3s cubic-bezier(0.76, 0, 0.24, 1);
color: #54b3d6;
}
.text-animate2:hover::before {
transform-origin: 0% 50%;
transform: scaleX(1);
}
.text-animate2:hover::after {
transform: translate3d(0, 0, 0);
}
</style>
</head>
<body>
<h2>This is a simple exampple of hover effect in HTML and CSS.</h2>
<hr />
<div class="main">
<div class="obj1">
<p class="text-color">Text color</p>
</div>
<div class="obj2">
<p class="text-size">Text size</p>
</div>
<div class="obj3">
<p class="text-rotate">Text rotate</p>
</div>
<div class="obj4"></div>
<div class="obj5">
<p class="text-animate">Text Animate</p>
</div>
<p class="text-bg">Text bg</p>
<div class="obj6">
<p class="text-animate2">Text Animate</p>
</div>
</div>
<center>
<a href="/HTML_CSS_Effects/about.html">
<button class="button">Click Here</button>
</a>
</center>
</body>
</html>