-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcard-hover-effect.html
71 lines (71 loc) · 1.66 KB
/
card-hover-effect.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Card Hover Effect</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.card-main {
position: relative;
width: 250px;
height: 250px;
background-color: #f14e0d;
background-image: url(img/banana-4289613_1280.png);
background-size: 100% 100%;
border-radius: 32px;
transition: all 0.3s ease-in-out;
margin-right: 20px;
}
.card-hover {
width: 100%;
height: 100%;
position: relative;
background: rgba(0, 0, 0, 0.6);
color: white;
border-radius: 32px;
opacity: 0;
padding: 24px;
text-align: center;
transition: all 0.3s ease-in-out;
}
.card-main:hover .card-hover,
.card-main:active .card-hover {
opacity: 1;
transform: scale(1.03);
}
.form {
display: grid;
place-items: center;
}
</style>
</head>
<body>
<div class="card-main">
<div class="card-hover">
<h4>Banana</h4>
<p>Khete vari moja</p>
<a href="#">Buy Now</a>
</div>
</div>
<div class="card-main">
<div class="card-hover form">
<h4>Message</h4>
<br />
<input type="text" name="" id="" />
<br />
<button>Send</button>
</div>
</div>
</body>
</html>