Navigationskomponente
Eine reaktionsschnelle Navigationskomponente, die für die Benutzeroberfläche des Dunkelmodus entwickelt wurde, mit Links, Dropdown-Menüs und einem Logo, die alle mit Tailwind CSS gestaltet sind.
HTML-Code
<nav class="bg-gray-800 p-4 fixed w-full">
<div class="flex justify-between items-center">
<div class="text-white text-lg font-bold">
<a href="#" class="flex items-center">
<img src="https://picsum.photos/40" alt="Logo" class="mr-2 rounded-full">
MyApp
</a>
</div>
<div class="hidden md:flex space-x-4">
<a href="#" class="text-gray-300 hover:bg-gray-700 px-3 py-2 rounded">Home</a>
<a href="#" class="text-gray-300 hover:bg-gray-700 px-3 py-2 rounded">About</a>
<div class="relative">
<button class="text-gray-300 hover:bg-gray-700 px-3 py-2 rounded flex items-center">Services
<svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"/>
</svg>
</button>
<div class="absolute left-0 hidden bg-gray-800 text-white mt-1 rounded shadow-md w-40">
<a href="#" class="block px-4 py-2 hover:bg-gray-700">Web Design</a>
<a href="#" class="block px-4 py-2 hover:bg-gray-700">SEO</a>
<a href="#" class="block px-4 py-2 hover:bg-gray-700">Marketing</a>
</div>
</div>
<a href="#" class="text-gray-300 hover:bg-gray-700 px-3 py-2 rounded">Contact</a>
</div>
<div class="md:hidden">
<button class="text-gray-300 hover:bg-gray-700 px-3 py-2 rounded focus:outline-none">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16m-7 6h7"/>
</svg>
</button>
</div>
</div>
</nav>
<div class="mt-16 p-4">
<h1 class="text-3xl text-white">Welcome to MyApp</h1>
<p class="text-gray-300">This is an example of a dark mode navigation component using Tailwind CSS.</p>
</div>
<style>
.dropdown:hover .dropdown-content {
display: block;
}
</style>
Verwandte Komponenten
3D-Navigationskomponente
Eine reaktionsschnelle 3D-Navigationskomponente für den E-Commerce mit einem Graustufen-Farbschema und Unterstützung für den Dunkelmodus.
Navigationskomponente
Eine reaktionsschnelle Navigationskomponente im Dunkelmodus, die für den E-Commerce mit einem pastellfarbenen Farbschema und einem einfachen Layout entwickelt wurde.
RetroNav
Eine einfache, reaktionsschnelle und mit dem Dunkelmodus kompatible Navigationskomponente mit Retro-/Vintage-Design, lebendigem Farbschema und minimalen Elementen, die für E-Commerce-Websites geeignet ist.