Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

HTML & CSS Drop-down menu not seperated

Hello,
When making two drop down menu's, I fail to seperate them; now when I hover over one of them, the other menu also pops up. How can I get this so that when I hover over one menu, the other doesn't pop up? Thanks!


Schermafbeelding 2022-01-16 153230.png


Code:
HTML:
    </div>
        <div class="dropdown">
            <button>Nieuws</button>
            <div class="dropdown-content">
                <a href="Nieuws.html">Link 1</a>
                <a href="#">Link 2</a>
                <a href="#">Link 3</a>

            </div>
            
CSS

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(0,0,0,0.7);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;

}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #ddd;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: #3e8e41;
 

Latest posts

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom