File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 1
- /* Basic styles for the navigation bar */
1
+ /* Basic styling for the navigation bar */
2
2
.navbar {
3
+ position : fixed; /* Make the navbar fixed */
4
+ top : 0 ;
5
+ left : 0 ;
6
+ right : 0 ;
7
+ z-index : 1000 ; /* Ensure it stays above other elements */
3
8
background-color : # 333 ;
4
- color : # fff ;
5
9
padding : 10px 0 ;
10
+ box-shadow : 0 2px 5px rgba (0 , 0 , 0 , 0.2 ); /* Optional shadow for visual separation */
6
11
}
7
12
8
13
.navbar .container {
9
14
display : flex;
10
- justify-content : space-between;
11
15
align-items : center;
16
+ justify-content : space-between;
12
17
max-width : 1200px ;
13
18
margin : 0 auto;
14
19
padding : 0 20px ;
15
20
}
16
21
22
+ /* Logo styling */
17
23
.navbar .logo {
18
24
font-size : 1.5rem ;
19
25
color : # fff ;
20
26
text-decoration : none;
21
27
}
22
28
29
+ /* Navigation links as a row */
23
30
.navbar .nav-links {
24
- list-style : none;
25
31
display : flex;
26
32
gap : 20px ;
27
33
}
28
34
29
- .navbar .nav-links li {
30
- margin : 0 ;
31
- }
32
-
33
- .navbar .nav-links li a {
35
+ .navbar .nav-links a {
34
36
color : # fff ;
35
37
text-decoration : none;
36
38
font-size : 1rem ;
37
39
padding : 8px 12px ;
38
40
transition : background-color 0.3s ;
39
41
}
40
42
41
- .navbar .nav-links li a : hover {
43
+ .navbar .nav-links a : hover {
42
44
background-color : # 555 ;
43
45
border-radius : 4px ;
44
46
}
47
+
48
+ /* Add padding to the body to avoid content hiding behind the fixed navbar */
49
+ body {
50
+ padding-top : 60px ; /* Adjust this value based on the navbar height */
51
+ }
You can’t perform that action at this time.
0 commit comments