Open links in new tab
  1. Like
    Dislike

    How To Create a Hoverable Dropdown Menu - W3Schools

    HTML Drop-down Menu – How to Add a Drop-…

    You'll also learn the various options available, and how to create a hoverable drop-down lis…

    FreeCodecamp
    The Complete Guide to <select> and Custom …

    In this guide, we’ll explore the different ways to create dropdown menus in HTML. We’ll start wit…

    Formspree
  1. A dropdown menu is a toggleable menu that allows users to choose one value from a predefined list. It can be created using HTML and CSS, and can be styled to fit the design of your website.

    Basic Dropdown Example

    To create a basic dropdown, you need to use HTML to define the structure and CSS to style it. Here is an example:

    HTML

    <div class="dropdown">
    <button class="dropbtn">Dropdown</button>
    <div class="dropdown-content">
    <a href="#">Link 1</a>
    <a href="#">Link 2</a>
    <a href="#">Link 3</a>
    </div>
    </div>
    Copied!

    CSS

    /* Style the dropdown button */
    dropbtn {
    background-color: #4CAF50;
    color: white;
    padding: 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    }

    /* The container <div> - needed to position the dropdown content */
    dropdown {
    position: relative;
    display: inline-block;
    }

    /* Dropdown content (hidden by default) */
    dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    }

    /* Links inside the dropdown */
    dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    }

    /* Change color of dropdown links on hover */
    dropdown-content a:hover {
    background-color: #f1f1f1;
    }

    /* Show the dropdown menu on hover */
    dropdown:hover .dropdown-content {
    display: block;
    }

    /* Change the background color of the dropdown button when the dropdown content is shown */
    dropdown:hover .dropbtn {
    background-color: #3e8e41;
    }
    Copied!
    Feedback
  2. HTML Dropdown - GeeksforGeeks

    Dec 5, 2025 · A basic HTML dropdown can be created using the <select> and <option> elements. Each <option> represents an item in the dropdown list, and the value attribute specifies the value submitted …

  3. HTML Drop-down Menu – How to Add a Drop-Down List with the …

    Sep 26, 2022 · You'll also learn the various options available, and how to create a hoverable drop-down list/menu. In HTML, by default, you can always create a drop-down list with the select tag alongside …

  4. People also ask