-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrandom.html
More file actions
109 lines (96 loc) · 2.17 KB
/
Copy pathrandom.html
File metadata and controls
109 lines (96 loc) · 2.17 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Navbar with Dropdown</title>
<style>
body {
margin: 0;
font-family: 'Poppins', sans-serif;
}
/* Navbar base */
.navbar {
background-color: #c60000;
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 40px;
}
.navbar a {
color: white;
text-decoration: none;
padding: 10px 16px;
font-weight: 500;
display: inline-block;
}
.navbar a:hover {
background-color: #a30000;
border-radius: 6px;
}
/* Dropdown container */
.dropdown {
position: relative;
display: inline-block;
}
/* Dropdown button */
.dropbtn {
background: none;
border: none;
color: white;
font-size: 16px;
cursor: pointer;
padding: 10px 16px;
font-weight: 500;
}
.dropbtn:hover {
background-color: #a30000;
border-radius: 6px;
}
/* Dropdown content */
.dropdown-content {
display: none;
position: absolute;
background-color: white;
min-width: 180px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
z-index: 10;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #f5f5f5;
}
/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
display: block;
}
</style>
</head>
<body>
<nav class="navbar">
<div class="logo">
<a href="#">MyBrand</a>
</div>
<div class="nav-links">
<a href="#">Home</a>
<a href="#">About</a>
<!-- Dropdown menu -->
<div class="dropdown">
<button class="dropbtn">Services ▾</button>
<div class="dropdown-content">
<a href="#">Web Development</a>
<a href="#">UI/UX Design</a>
<a href="#">Machine Learning</a>
</div>
</div>
<a href="#">Contact</a>
</div>
</nav>
</body>
</html>