Vissza a webes elemekhez
Navigáció

Lebegő szegmenses menü

Élő előnézet – a komponens teljes méretben.

Élő előnézet
HTML · CSS · JS
HTML
<nav class="menu-segment">
    <a href="#" class="active">
        <span>Kezdőlap</span>
    </a>
    <a href="#">
        <span>Rólunk</span>
    </a>
    <a href="#">
        <span>Szolgáltatások</span>
    </a>
    <a href="#">
        <span>Portfólió</span>
    </a>
    <a href="#">
        <span>Kapcsolat</span>
    </a>
</nav>
CSS
.menu-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px;
    background: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.menu-segment a {
    position: relative;
    padding: 14px 22px;
    color: #8490a1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    border-radius: 8px;
    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

.menu-segment a::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(46, 204, 113, 0);
    border-radius: 6px;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.menu-segment a:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.menu-segment a:hover::before {
    border-color: rgba(46, 204, 113, 0.3);
}

.menu-segment a.active {
    color: #ffffff;
    background: rgba(46, 204, 113, 0.08);
    box-shadow: inset 0 0 18px rgba(46, 204, 113, 0.035);
}

.menu-segment a.active::before {
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.08);
}

@media (max-width: 700px) {
    .menu-segment {
        flex-wrap: wrap;
    }

    .menu-segment a {
        padding: 10px 15px;
    }
}
JavaScript
Ehhez az elemhez nincs külön JavaScript.