Skip to content

Commit 5d048f1

Browse files
authored
Update nav.css
1 parent 467bbcf commit 5d048f1

File tree

1 file changed

+59
-141
lines changed

1 file changed

+59
-141
lines changed

assets/css/nav.css

Lines changed: 59 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,163 +1,81 @@
1-
2-
/* Add a black background color to the top navigation */
1+
/* Fixed top navigation bar */
32
.topnav {
43
background-color: #ffffff;
54
overflow: hidden;
6-
position:fixed;
7-
z-index:999;
8-
width:100%;
9-
}
10-
11-
12-
.topnav #myLinks {
13-
display: inline;
14-
}
5+
position: fixed;
6+
z-index: 999;
7+
width: 100%;
8+
top: 0; /* Aligns the navigation bar to the top */
9+
display: flex;
10+
align-items: center;
11+
justify-content: space-between;
12+
padding: 0 10px;
13+
box-sizing: border-box;
14+
}
1515

16-
.topnav a.icon {
17-
display: none;
16+
/* Container for links, aligned to the left */
17+
.topnav #myLinks {
18+
display: flex;
19+
gap: 10px;
20+
margin-left: 10px;
1821
}
1922

20-
.topnav img {
21-
margin-bottom:0pt;
22-
margin-top:10pt;
23-
margin-left:30%;
24-
}
25-
26-
/* Style the links inside the navigation bar */
27-
.topnav a.normal {
28-
float: right;
23+
/* Links inside the navigation bar */
24+
.topnav a.normal {
2925
color: #808080;
30-
text-align: center;
3126
padding: 10px 9px;
3227
text-decoration: none;
3328
font-size: 17px;
34-
}
35-
36-
/* Change the color of links on hover */
37-
.topnav a.normal:hover {
29+
display: inline-block;
30+
}
31+
32+
/* Hover effect for links */
33+
.topnav a.normal:hover {
3834
background-color: #ddd;
3935
color: black;
40-
}
41-
42-
/* Add a color to the active/current link */
43-
.topnav a.right {
44-
margin-right:30%;
45-
}
46-
47-
@media print, screen and (max-width: 1000px) {
36+
}
4837

49-
.topnav img {
50-
margin-left:3%;
51-
}
38+
/* Hamburger icon for mobile */
39+
.topnav a.icon {
40+
display: none; /* Hidden by default */
41+
color: #808080;
42+
font-size: 24px;
43+
padding: 10px;
44+
}
5245

53-
.topnav a.right {
54-
margin-right:3%;
55-
}
46+
/* Image logo styling */
47+
.topnav img {
48+
margin: 0;
49+
padding: 10px;
50+
vertical-align: middle;
51+
max-height: 50px;
52+
}
5653

57-
.topnav a.normal {
58-
padding: 10px 5px;
54+
/* Responsive design adjustments for mobile */
55+
@media screen and (max-width: 960px) {
56+
.topnav {
57+
flex-direction: column; /* Stacks items vertically */
58+
align-items: flex-start; /* Aligns items to the left */
5959
}
6060

61-
}
62-
63-
@media print, screen and (max-width: 1200px) and (min-width: 1001px) {
64-
65-
.topnav img {
66-
margin-left:6%;
67-
}
68-
.topnav a.right {
69-
margin-right:6%;
70-
}
71-
72-
}
73-
74-
@media print, screen and (max-width: 1400px) and (min-width: 1201px) {
75-
76-
.topnav img {
77-
margin-left:12%;
78-
}
79-
.topnav a.right {
80-
margin-right:12%;
81-
}
82-
83-
}
84-
85-
86-
@media print, screen and (max-width: 1600px) and (min-width: 1401px) {
87-
88-
.topnav img {
89-
margin-left:16%;
90-
}
91-
.topnav a.right {
92-
margin-right:16%;
93-
}
94-
95-
}
96-
97-
@media print, screen and (max-width: 1800px) and (min-width: 1601px) {
98-
99-
.topnav img {
100-
margin-left:19%;
101-
}
102-
.topnav a.right {
103-
margin-right:19%;
104-
}
105-
106-
}
107-
108-
@media print, screen and (max-width: 2000px) and (min-width: 1801px) {
109-
110-
.topnav img {
111-
margin-left:22%;
112-
}
113-
.topnav a.right {
114-
margin-right:22%;
115-
}
116-
117-
}
118-
119-
120-
@media print, screen and (max-width: 480px) {
121-
.topnav #myLinks {
122-
display: none;
123-
}
124-
}
125-
126-
@media print, screen and (max-width: 960px) {
127-
12861
.topnav #myLinks {
129-
display: none;
130-
}
131-
132-
.topnav a.normal {
133-
color: white;
134-
float: none;
135-
padding: 14px 16px;
136-
text-decoration: none;
137-
font-size: 17px;
138-
display: block;
139-
}
62+
display: none; /* Hidden by default */
63+
flex-direction: column; /* Stacks links vertically */
64+
width: 100%; /* Full width for mobile */
65+
background-color: #ffffff; /* White background for dropdown */
66+
}
14067

141-
.topnav a.icon {
142-
color: white;
143-
display: block;
144-
padding: 10px 16px;
145-
font-size: 17px;
68+
.topnav a.icon {
69+
display: block; /* Shows the hamburger icon */
14670
position: absolute;
147-
float: right;
148-
right: 0;
149-
top: 0;
150-
margin-right:5%;
151-
}
71+
right: 10px;
72+
top: 10px;
73+
}
15274

153-
.topnav a.right {
154-
color: white;
155-
float: none;
156-
padding: 14px 16px;
157-
text-decoration: none;
158-
font-size: 17px;
75+
.topnav a.normal {
15976
display: block;
160-
margin-right:0;
161-
}
162-
}
163-
77+
width: 100%;
78+
text-align: left; /* Aligns links to the left */
79+
padding: 14px 16px;
80+
}
81+
}

0 commit comments

Comments
 (0)