---
title: "How to dropdown menu using HTML and CSS?"  
description: "How to dropdown menu using HTML and CSS?"  
author: "Ravi Vishwakarma"  
published: 2021-07-19  
canonical: https://answers.mindstick.com/qa/93774/how-to-dropdown-menu-using-html-and-css  
category: "web application"  
tags: ["javascript", "html5", "css cascading style sheets"]  
reading_time: 2 minutes  

---

# How to dropdown menu using HTML and CSS?

How to [dropdown](https://www.mindstick.com/articles/263/ajax-toolkit-dropdownextender-in-asp-dot-net) menu using [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) and [CSS](https://www.mindstick.com/articles/12349/a-step-by-step-guide-to-making-pure-css-tooltips)?

## Answers

### Answer by Ethan Karla

```
<!DOCTYPE html>
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <meta charset='utf-8' />
    <title></title>
    <style>
        span {
            padding:5px;
            background-color:#658587;
            text-align:center;
        }
        p {
            text-align:center;
            padding:10px;
            background-color:#fff;
            border-radius:10px;
            transition:0.5s;
        }
            p:hover {
                color:white;
                font-size:20px;
                cursor:pointer;
                background-color:#57C16F;
            }
        .dropdown {
            position: relative;
            display: inline-block;
        }
        .dropdown-content {
            display: none;
            position: absolute;
            background-color: #B5D0D2;
            border-radius:10px;
            min-width: 160px;
            box-shadow: 0px 8px 16px 0px rgba(4,0,0,0.2);
            padding: 5px;
            z-index: 1;
        }
        .dropdown:hover .dropdown-content {
            display: block;
        }
    </style>
</head>
<body>
    <h2>Hoverable Dropdown</h2>
    <h3>Hover on the fruits button </h3>
    <p>Move the mouse over the text below to open the dropdown content.</p>
    <div class='dropdown'>
        <span>Fruits </span>
        <div class='dropdown-content'>
            <p>Apple</p>
            <p>Banana</p>
            <p>Orange</p>
            <p>Grapes</p>
            <p>Mango</p>
            <p>Chery</p>
            <p>Kiwi</p>
        </div>
    </div>
</body>
</html>
```

\


---

Original Source: https://answers.mindstick.com/qa/93774/how-to-dropdown-menu-using-html-and-css

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
