组件 页眉 头部组件

头部组件

一个具有复古/古典设计的响应式头部组件,支持暗黑主题,并展现80年代/90年代的怀旧美学。

预览

HTML 代码

<header class="bg-gray-800 text-white p-5 shadow-md">
    <div class="container mx-auto flex justify-between items-center">
        <div class="flex items-center">
            <img class="w-12 h-12 rounded-full" src="https://randomuser.me/api/portraits/men/1.jpg" alt="User Avatar">
            <h1 class="ml-3 text-lg font-bold">Retro Header</h1>
        </div>
        <nav class="hidden md:flex space-x-4">
            <a href="#" class="text-lg hover:text-gray-400">Home</a>
            <a href="#" class="text-lg hover:text-gray-400">About</a>
            <a href="#" class="text-lg hover:text-gray-400">Services</a>
            <a href="#" class="text-lg hover:text-gray-400">Contact</a>
        </nav>
        <button class="md:hidden 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"></path>
            </svg>
        </button>
    </div>
    <div class="mt-4 text-center">
        <img class="mx-auto rounded-lg shadow-lg" src="https://picsum.photos/400/200?random=1" alt="Random Placeholder">
        <p class="mt-2 text-sm text-gray-400">A touch of nostalgia from the 80s/90s.</p>
    </div>
</header>
<style>
@media (prefers-color-scheme: dark) {
    header {
        background-color: #1c1c1c;
    }
    a {
        color: #cbd5e1;
    }
    a:hover {
        color: #f3f4f6;
    }
}
</style>

相关组件

社交媒体头部

一个为社交媒体界面设计的响应式头部组件,采用暗模式用户界面,使用三元色彩方案和简洁元素。它包括一个网站标题、一个搜索栏和用户资料链接,样式适用于暗模式,使用Tailwind CSS。

打开

头部组件

一个响应式的头部组件,具有微交互功能、小型吸引人的动画,并支持使用Tailwind CSS的暗黑主题。

打开

标题组件

一个响应式页头组件,采用极简主义风格,具有淡色配色方案,适用于博客或内容网站,并包含深色主题支持。

打开