-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSS4.html
More file actions
95 lines (87 loc) · 1.97 KB
/
CSS4.html
File metadata and controls
95 lines (87 loc) · 1.97 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hoverable Sidenav Buttons</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
}
.sidenav {
width: 150px; /* Initial width */
position: fixed;
z-index: 1;
top: 0;
left: 0;
overflow-x: hidden;
transition: 0.5s;
padding-top: 60px;
}
.s1 {
background-color: aqua;
}
.s2 {
background-color: red;
}
.s3 {
background-color: green;
}
.s4 {
background-color: orange;
}
.sidenav:hover {
width: 250px; /* Expanded width */
}
.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s;
}
.sidenav a:hover {
color: #f1f1f1;
}
.main {
margin-left: 150px;
padding: 20px;
transition: margin-left 0.5s;
}
.sidenav:hover + .main {
margin-left: 250px;
}
.description {
margin-top: 20px;
font-size: 18px;
color: #333;
}
</style>
</head>
<body>
<div class="sidenav">
<div class="s1">
<a href="#">Home</a>
</div>
<div class="s2">
<a href="#">About</a>
</div>
<div class="s3">
<a href="#">Services</a>
</div>
<div class="s4">
<a href="#">Contact</a>
</div>
</div>
<div class="main">
<h1>Hoverable Sidenav Buttons</h1>
<p class="description">
Hover over the buttons in the left side navigation to open them.
</p>
</div>
</body>
</html>