I have been attempting to implement a Fixed Navigation Bar
using Tailwind CSS
and have the main page scroll with a sticky effect, but I'm encountering difficulties in getting it to function properly...
Here is the current state of my progress:
https://i.sstatic.net/9g8C3.png
Below is the code I have so far:
<!-- NavBar -->
<header class="fixed bg-blue-600 shadow-md z-50 w-full px-5 py-2 flex justify-between items-center">
<router-link to="/" class="text-2xl text-white">My App</router-link>
<div>
<router-link to="/login" class="text-white hover:bg-gray-700 px-3 rounded py-1">Login</router-link>
<router-link to="/register" class="text-white hover:bg-gray-700 px-3 rounded py-1">Register</router-link>
</div>
</header>
<div class="flex">
<!-- Sidebar -->
<aside class="fixed bg-white h-screen py-5 shadow">
<div class="flex flex-col text-left">
<router-link to="/" class="hover:bg-gray-400 px-12 py-2 rounded">
<i class="fa fa-dashboard"></i>
<span class="">Dashboard</span>
</router-link>
</div>
</aside>
<!-- Main Page -->
<main class="bg-gray-200 flex-1">
<transition name="slide-fade">
<router-view></router-view>
</transition>
</main>
</div>