-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnested_dropdown.css
59 lines (51 loc) · 1.38 KB
/
nested_dropdown.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
/* Dropdown styling */
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none; /* Hidden by default */
position: absolute;
background-color: #333; /* Dark background */
min-width: 160px;
z-index: 1;
padding: 0;
}
/* Show dropdown content on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Styling for dropdown links */
.dropdown-content a {
color: white; /* Light text for dark background */
padding: 12px 16px;
text-decoration: none;
display: block;
}
/* Hover effect for dropdown links */
.dropdown-content a:hover {
background-color: #444; /* Slightly lighter on hover */
}
/* Submenu structure with arrows for submenu triggers */
.dropdown-submenu {
position: relative;
/* padding-right: 16px; /* Space for the arrow */ */
}
.dropdown-submenu > .submenu-trigger::after {
content: "▶"; /* Arrow indicating a submenu */
float: right;
}
/* Submenu content, positioned to the right */
.dropdown-submenu-content {
display: none; /* Hidden by default */
position: absolute;
left: 100%; /* Aligns the submenu to the right of the parent */
top: 0;
background-color: #333; /* Dark background */
z-index: 1;
min-width: 160px;
}
/* Show only the immediate submenu on hover */
.dropdown-submenu:hover > .dropdown-submenu-content {
display: block;
}