Prev Demo
Dropdown Menu
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Dropdown menu</title> <style> .dropbtn { background-color: green; color: white; padding: 20px; font-size: 20px; border: none; } .dropdown { position: relative; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: pink; min-width: 140px; } .dropdown-content a { color: orange; padding: 12px 16px; text-decoration: none; display: block; } .dropdown-content a:hover { background-color: red; } .dropdown:hover .dropdown-content { display: block; } .dropdown:hover .dropbtn { background-color:magenta; } </style> </head> <body> <h2>Dropdown Menu</h2> <p>Move the mouse over the button to open the dropdown menu.</p> <div class="dropdown"> <button class="dropbtn">TechFunda</button> <div class="dropdown-content"> <a href="#">AngularJS</a> <a href="#">JavaScript</a> <a href="#">CSS</a> </div> </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output