-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcss4.html
87 lines (75 loc) · 2.1 KB
/
css4.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<html lang="en"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Task-9</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin-top: 0;
}
.main {
border-style: solid;
border-color: black;
border-width: 1px;
height: 400px;
width: 500px;
display: flex;
}
.sidenav {
display: flex;
flex-direction: column;
padding-top: 20px;
align-items: center; /* Center the content vertically */
}
.d1,
.d2,
.d3,
.d4 {
width: 35px;
height: 35px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
background-color: transparent;
margin-bottom: 10px;
transition: transform 0.1s; /* Add a transition for smooth change */
}
.d1:hover,
.d2:hover,
.d3:hover,
.d4:hover {
transform: scale(1.1); /* Scale the individual div on hover */
}
.d1 {
background-color: rgb(18, 154, 74);
}
.d2 {
background-color: rgb(32, 146, 239);
}
.d3 {
background-color: rgb(235, 35, 35);
}
.d4 {
background-color: rgb(34, 30, 30);
}
.p-content {
padding-left: 30px;
}
</style>
</head>
<body>
<div class="main">
<div class="sidenav">
<div class="d1"></div>
<div class="d2"></div>
<div class="d3"></div>
<div class="d4"></div>
</div>
<div class="p-content">
<h3><b>Hoverable Sidenav Buttons</b></h3>
<p>Hover over the buttons in the left side navigation to open them.</p>
</div>
</div>
</body></html>