-
Notifications
You must be signed in to change notification settings - Fork 0
/
navbar.css
100 lines (87 loc) · 2.19 KB
/
navbar.css
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
/* Navbar styling */
.navbar {
background-color: #2c2c3a;
padding: 10px 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
margin-bottom: 30px;
}
/* Navbar links */
.nav-links {
list-style-type: none;
display: flex;
justify-content: center; /* Center all the navigation items */
gap: 30px; /* Space between links */
align-items: center; /* Vertically center links */
}
.nav-links li {
display: inline-block;
}
/* General link styles */
.nav-links a {
text-decoration: none;
color: #fff;
font-size: 22px;
font-weight: bold;
transition: color 0.3s ease;
text-align: center; /* Keep text center-aligned */
display: block; /* Full block for better layout control */
}
.nav-links a:hover {
color: #a68ab7;
}
/* Dropdown styling */
.nav-links .dropdown {
position: relative;
display: inline-block;
text-align: center; /* Center the dropdown title */
}
/* Dropdown content */
.dropdown-content {
display: none;
position: absolute;
left: 50%;
transform: translateX(-50%); /* Horizontally center the dropdown */
background-color: #2c2c3a;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
padding: 10px 0;
min-width: 275px;
z-index: 1;
}
/* Individual dropdown links */
.dropdown-content li {
display: block;
padding: 10px 20px;
}
.dropdown-content li a {
color: #fff;
text-decoration: none;
display: block;
font-size: 16px;
}
.dropdown-content li a:hover {
background-color: #696969;
}
/* Show the dropdown on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Mobile responsive for smaller screens */
@media (max-width: 768px) {
.nav-links {
flex-direction: column;
align-items: center; /* Center the items vertically */
gap: 15px;
}
/* Dropdown content for mobile */
.dropdown-content {
left: 0;
right: 0;
transform: none; /* No need to center horizontally */
width: 100%; /* Full width on small screens */
position: relative; /* Relative to avoid navbar flow disruption */
}
/* Ensure dropdown works on mobile */
.dropdown:hover .dropdown-content {
display: block;
}
}