-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSS_Task4.html
75 lines (64 loc) · 1.69 KB
/
CSS_Task4.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
<!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;
}
.sidenav {
height: 100%;
width: 100px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
overflow-x: hidden;
padding-top: 20px;
}
.sidenav a {
padding: 20px 8px;
text-decoration: none;
font-size: 25px;
display: block;
transition: 0.3s;
height: 60px;
width: 60px;
}
.sidenav a:hover {
padding-left: 100px;
}
.sidenav .green {
background-color: green;
}
.sidenav .blue {
background-color: blue;
}
.sidenav .red {
background-color: red;
}
.sidenav .grey {
background-color: grey;
}
.main {
margin-left: 80px; /* Same width as the sidenav + some extra */
font-size: 28px; /* Increased text to enable scrolling */
padding: 0px 10px;
}
</style>
</head>
<body>
<div class="sidenav">
<a href="#" class="green"></a>
<a href="#" class="blue"></a>
<a href="#" class="red"></a>
<a href="#" class="grey"></a>
</div>
<div class="main">
<h2>Hoverable Sidenav Buttons</h2>
<p>Hover over the buttons in the left side navigation to open them.</p>
</div>
</body>
</html>