-
Shraddha Raghuram authoredShraddha Raghuram authored
navbar.css 5.53 KiB
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
@font-face {
font-family: AccidenzCommons;
src: url(https://static.igem.wiki/teams/5054/ccaccidenzcommons-medium.otf);
}
body{
background: #C6EBE8;
}
.my-nav{
/* top: 0;
width: 100%;
height: 78px;
background: #C6EBE8;
backdrop-filter: blur(5px);
display: flex;
justify-content: space-between;
position: fixed;
z-index: 10;
transition: all 0.2s linear; */
height: 100px; /* Increase the height of the nav container */
display: flex;
justify-content: space-between;
position: fixed;
width: 100%;
z-index: 10;
transition: all 0.2s linear;
backdrop-filter: blur(5px);
background: #C6EBE8;
align-items: center; /* Ensure vertical alignment */
}
.my-nav .icon{
/* flex-basis: 200px;
margin-top: 10px;
margin-left: 5px;
margin-bottom: 7px;
background-image: url(https://static.igem.wiki/teams/5054/logo-kleur.svg);
background-position-x: -30px;
text-decoration: none;
background-repeat: no-repeat; */
flex-basis: 200px; /* Make sure this is large enough for the logo */
height: 100%; /* Ensure the icon container height matches the nav */
margin: 0 30px; /* Adjust margin to properly position the logo */
background-image: url(https://static.igem.wiki/teams/5054/logo-kleur.svg);
background-size: contain; /* Adjust to contain the entire logo */
background-position: center; /* Center the logo */
background-repeat: no-repeat;
overflow: visible; /* Prevent cutting off the logo */
}
.my-navbar{
height: 50px;
margin-left: 5px;
margin-right: 50px;
/* margin-top: 24px; */
margin-top: 0px;
list-style: none;
}
.my-navbar>li{
float: left;
width: 120px;
height: 110%;
margin-right: 25px;
}
#human-practice{
width: 250px;
margin-right: 30px;
}
#edu{
width: 110px; /* Increase the width for "Education" */
margin-right: 30px; /* Ensure sufficient space between "Education" and "Safety" */
}
.my-navbar>li a{
color: var(--text, var(--text, rgba(24, 90, 79, 1)));
font-family: AccidenzCommons;
font-size: 25px;
font-style: normal;
font-weight: 400;
line-height: normal;
text-decoration: none;
transition: color 0.15s linear;
}
.son{
margin-top: 30px;
list-style: none;
visibility: hidden;
opacity: 0;
transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}
.my-navbar > li:hover .son {
visibility: visible;
opacity: 1;
}
.my-navbar > li {
float: left;
width: 120px;
height: 110%;
margin-right: 25px;
position: relative; /* Add this to position the dropdown relative to the parent */
}
.my-navbar > li .son {
margin-top: 0; /* Remove any margin */
padding: 0; /* Remove any padding */
position: absolute; /* Position it absolutely */
top: 100%; /* Position it directly below the parent li */
left: 0; /* Align it directly under the parent */
width: 100%; /* Make sure it is the same width as the parent */
background-color: #C6EBE8; /* Make sure the background matches the navbar */
z-index: 1000; /* Ensure it appears above other content */
}
.my-navbar > li .son li {
width: 100%; /* Ensure the dropdown items take full width */
}
/* Adjust for smaller screens */
@media screen and (max-width:1130px) {
.my-nav .icon {
flex-basis: 100px; /* Reduce the width for smaller screens */
margin: 0 10px; /* Adjust margins for smaller screens */
background-size: contain;
background-position: center;
}
}
@media screen and (min-width:1800px){
.my-navbar>li{
width: 150px;
}
#human-practice{
width: 280px;
}
#edu{
width:130px;
}
.my-nav>ul>li a{
font-size: 30px;
}
.my-navbar{
margin-top: 25px;
}
.my-nav .icon{
flex-basis: 240px;
margin-left: 25px;
margin-top: 15px;
}
.my-nav{
height: 84px;
}
}
@media screen and (max-width:1450px) and (min-width:1280px){
.my-navbar>li{
width: 100px;
}
#human-practice{
width: 210px;
}
#edu {
width: 100px; /* Increase width for "Education" in this range */
}
.my-nav>ul>li a{
font-size: 22px;
}
.my-navbar{
margin-top: 23px;
}
.my-nav .icon{
flex-basis: 200px;
margin-left: 18px;
}
.my-nav{
height: 74px;
}
}
@media screen and (max-width:1280px) and (min-width:1120px){
.my-navbar>li{
width: 88px;
}
#human-practice{
width: 190px;
}
#edu{
width:90px;
}
.my-nav>ul>li a{
font-size: 20px;
}
.my-navbar{
margin-top: 21px;
}
.my-nav .icon {
background-size: contain; /* Ensure the logo fits within the container */
background-position: center; /* Center the logo within the container */
}
.my-nav{
height: 70px;
}
}
@media screen and (max-width:1130px){
.my-navbar>li{
width: 78px;
}
#human-practice{
width: 160px;
}
#edu{
width:80px;
}
.my-nav>ul>li a{
font-size: 18px;
}
.my-navbar{
margin-top: 15px;
margin-left: 20px;
margin-right: 0px;
}
.my-nav .icon{
flex-basis: 50px;
margin: 0 10 px;
}
.my-nav{
height: 55px;
justify-content: center;
}
.son{
margin-top: 20px;
}
}
/* hide the navigation */
@media screen and (max-width:830px){
.my-navbar{
display: none;
}
}