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

Using Same Firebase for Web App as well as Android App

Using Same Firebase for Web App as well as Android App Create Android app in that project go to project setting click on iso or android or web icon.  Go to authentication select Google then enable select email Get client id from web sdk - Create.env.local  GOOGLE_CLIENT_ID=259eklrjelkjr GOOGLE_CLIENT_SECRET=GOlkelkrjer NEXTAUTH_URL=https://localhost:3000 - Restart the server/app - Create folder in pages/auth/signin.js

Topic Learned!

 Topic Learned! State : State is updated whenever user want to update it. Example : ToDo List Props:           Props would be whatever the current state is! useEffect:            componentDidMount() {             // Run This code while the app is loading          Example fetchUser();      } Alternative For componentDidMount(): In functional components    //On Every Render   useEffect (() => {     console . log ( "I re-rendered" );   }); Alternative For componentDidMount() but runs only in first Render: //On First Render/Mount - componentDidMount   useEffect (() => {     console . log ( "Component Is Mounted" );   }, []); Alternative for componentDidUpdate(): //On First Render + whenever the component changes   //componentDidUpdate alternative   useEffect (() => {   ...