Advertisement
Guest User

Tailwind CSS - Responsive Navbar

a guest
Sep 12th, 2019
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.12 KB | None | 0 0
  1. <style>
  2.     #menu-toggle:checked + #menu {
  3.       display: block;
  4.     }
  5. </style>
  6.  
  7. <body class="antialiased bg-gray-200">
  8.   <header class="lg:px-16 px-6 bg-white flex flex-wrap items-center lg:py-0 py-2 shadow">
  9.     <div class="flex-1 flex justify-between items-center">
  10.       <a href="#">
  11.         <img src="https://i.ibb.co/nz1S1c2/logo.png" class="h-12" alt="Logo">
  12.       </a>
  13.     </div>
  14.  
  15.     <label for="menu-toggle" class="cursor-pointer lg:hidden block"><svg class="fill-current text-gray-900" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>menu</title><path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"></path></svg></label>
  16.     <input class="hidden" type="checkbox" id="menu-toggle" />
  17.  
  18.     <div class="hidden lg:flex lg:items-center lg:w-auto w-full" id="menu">
  19.       <nav>
  20.         <ul class="lg:flex items-center justify-between text-base text-gray-700 pt-4 lg:pt-0">
  21.           <li><a class="lg:p-4 py-3 px-0 block border-b-2 border-transparent hover:border-indigo-400" href="#">Features</a></li>
  22.           <li><a class="lg:p-4 py-3 px-0 block border-b-2 border-transparent hover:border-indigo-400" href="#">Pricing</a></li>
  23.           <li><a class="lg:p-4 py-3 px-0 block border-b-2 border-transparent hover:border-indigo-400" href="#">Documentation</a></li>
  24.           <li><a class="lg:p-4 py-3 px-0 block border-b-2 border-transparent hover:border-indigo-400 lg:mb-0 mb-2" href="#">Support</a></li>
  25.         </ul>
  26.       </nav>
  27.       <a href="#" class="lg:ml-4 flex items-center justify-start lg:mb-0 mb-4 cursor-pointer">
  28.         <img class="rounded-full w-10 h-10 border-2 border-transparent hover:border-indigo-400" src="https://blogcdn1.secureserver.net/wp-content/uploads/2014/06/create-a-gravatar-beard.png" alt="Andy Leverenz">
  29.       </a>
  30.     </div>
  31.   </header>
  32.  
  33.   <!-- INFO -->
  34.   <div class="px-4">
  35.     <div class="max-w-xl bg-white rounded-lg mx-auto my-12 p-12">
  36.       <h1 class="text-2xl font-medium mb-2">Tailwind CSS</h1>
  37.       <h2 class="font-medium text-sm text-indigo-400 mb-4 uppercase tracking-wide">Responsive Navbar</h2>
  38.       ...
  39.     </div>
  40.   </div>
  41. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement