Skip to main content

Responsive Nav Bar (CODE)

 


CSS:


nav {
    background#373B69;
    height60px;
    width100%;
    border-bottom2px solid rgba(0001);
    box-shadow0 20px 30px rgba(0000.2);
}

label.logo{
    colorwhitesmoke;
    font-size25px;
    line-height60px;
    padding0px 80px;
    font-weightbold;
}

nav ul {
    float:  right;
    margin-right0 10px;
}

nav ul li {
    displayinline-block;
    line-height60px;
    margin0 5px;
}

/* p {
    max-width: 90%;
    padding-left: 50px;
    padding-top: 30px;

} */
nav ul li a{
    colorblack;
    font-size15px;
    padding7px 13px;
    border-radius3px;
    text-transformuppercase;
}

a.activea:hover{
    background#EBE5E2;
    transition0.5s;
}

.checkbtn {
    font-size25px;
    coloraliceblue;
    floatright;
    line-height80px;
    margin-right40px;
    cursorpointer;
    displaynone;
}

#check {
    displaynone;
}


@media(max-width952px) {
    label.logo {
        font-size30px;
        padding-left50px;
    }
    nav ul li a {
        font-size16px;
    }

}
@media (max-width858px) {
    .checkbtn {
        displayblock;
    }

    ul {
        positionfixed;
        width100%;
        height60%;
        background#13688C;
        top80px;
        left-100%;
        transitionall 0.3s;
        text-aligncenter;
    }
    nav ul li {
        displayblock;
        margin50px 0;
        line-height30px;
    }
    nav ul li a {
        font-size20px;
    }
    a:hovera.active {
        backgroundnone;
        colorwhite;
    }
    #check:checked ~ ul {
        left0;
    }
}




html :

 <nav>
      <input type="checkbox" id="check" />
      <label for="check" class="checkbtn">
        <i class="fas fa-bars"></i>
      </label>
      <label class="logo">MihirX</label>
      <ul>
        <li><a href="#" class="active">Home</a></li>
        <li><a href="#">Codding</a></li>
        <li><a href="#">Me Time</a></li>
        <li><a href="#">Fun</a></li>
        <li><a href="#">Work</a></li>
      </ul>
    </nav>



Comments

Popular posts from this blog

VERCEL DEPLOYMENT ERROR

 VERCEL DEPLOYMENT ERROR Options | NextAuth.js (next-auth.js.org) Step 1 : cmd $ openssl rand -base64 32 (Copy generated key) Step 2: Go to Project Environment Variables Add NEXTAUTH_SECRET : Key  Step 3: Redeploy

Convert React Native To Expo

Convert React Native To Expo Step 1: Add Into App.json   "expo" : {     "sdkVersion" : "44.0.0" ,     "name" : "AwesomeProject"   } Step 2: Add this into your package.json    "dependencies" : {     "expo" : "^33.0.7" ,     "react" : "17.0.2" ,     "react-native" : "0.67.2"   }, Step 3: Make your Index.js file look like this AppRegistry . registerComponent ( 'main' , () => App ); Step 4: Install expo in your project folder In terminal paste npm install --save expo / npm install (If necessary)

Insta Asset R Native

 Insta Asset R Native Mm