Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

How to get this navigation responsive? And how does the pseudo code look like to change color on .navigation:link???

Is there a way to shorten and simplify this to become a nice and elegant drop down menu? And I don't understand why this menu aint responsive anymore.... I understand that it aint because of my relative units. So I suspect it has something to do with display - flex and flew-flow... Is this correct?

I would really appreciate if anybody here could share their experience and knowledge that you may have about dropdown navigations.

Best regards!

nav {
    background-color: #3A4652;
    width: 100%;
    padding-bottom: 0.525em;    
}

nav ul {
    list-style: none;
}

.navigation {
    display: flex;
    flex-flow: row;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    margin: 0.4em 10em;
    max-width: 100%;
}

.navigation > li {
    position: relative;
    display: inline-block;
    padding: 1rem 2rem;
    padding-bottom: 0.6em;
}

.navigation ul {
    position: absolute;
    z-index: 1010;
    line-height: 2rem;
    left: -9999em;
    border-top: 2px solid black;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    border-left: 2px solid black;
    padding: 0.210em 2em;
    background-color: #9C7F5A;
}

.navigation ul a {
    display: block;
}

.navigation > li:hover a + ul {
    left: 0;
    top: 100%;
}

.navborder {
    border-top: 3px solid black;
    border-bottom: 3px solid black;
    width: 100%;
}

.bordermenu {
    border-top: 2px solid black;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    border-left: 2px solid black;
    padding: 0.210em 3em;
    background-color: #9C7F5A;
}

.bordermenu2 {
    border-top: 2px solid black;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    border-left: 2px solid black;
    padding: 0.210em 3.5em;
    background-color: #9C7F5A;
}

.bordermenu3 {
    border-top: 2px solid black;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    border-left: 2px solid black;
    padding: 0.210em 2em;
    background-color: #9C7F5A;
}

.bordermenu4 {
    border-top: 2px solid black;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    border-left: 2px solid black;
    padding: 0.210em 3.235em;
    background-color: #9C7F5A;
}
<header id="top" class="main-header"> 
        <nav class="navborder">
            <ul class="navigation nav-open" id="nav">
                <li><a href="index.html" class="selected bordermenu">Hjem</a></li>
                <li><a href="#" class="bordermenu2">Om</a>
                    <ul class="submenu">
                        <li><a href="#">Om Naturens Fristelser</a></li>
                        <li><a href="#">Om Meg</a></li>
                    </ul>
                </li>
                <li><a href="#" class="bordermenu3">Gresskarkjerneolje</a>
                    <ul class="submenu">
                        <li><a href="#">Om Oljen</a></li>
                        <li><a href="#">Bestill Oljen</a></li>
                        <li><a href="#">Eksport</a></li>
                    </ul>
                </li>
                <li><a href="#" class="bordermenu4">Kontakt</a></li>
            </ul>
        </nav>
        <div class="title">
            <span>Nettstedet der god mat lages</span>
            <h1>Naturens Fristelser</h1>
        <img src="img/arrow.svg" class="arrow" alt="Down arrow">
        </div>
    </header>