How to create dropdown menu in html css | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to create dropdown menu in html css

Dropdown menu

10th Apr 2021, 1:20 PM
Azad Shami
Azad Shami - avatar
8 Answers
+ 6
<style> .dropdown { position: relative; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); padding: 12px 16px; z-index: 1; } .dropdown:hover .dropdown-content { display: block; } </style> <div class="dropdown"> <span>Mouse over me</span> <div class="dropdown-content"> <p>Hello World!</p> </div> </div>
13th Feb 2022, 8:16 AM
ElSirGuti
ElSirGuti - avatar
10th Apr 2021, 1:24 PM
Apongpoh Gilbert
Apongpoh Gilbert - avatar
+ 3
Use select and option tag.
25th Jan 2022, 9:54 AM
Mishu
Mishu - avatar
+ 2
Read 25.1 lesson jQuery course or use Bootstrap component.
23rd May 2022, 2:19 PM
dotinto
dotinto - avatar
+ 1
Hi! A simple way to get a dropdown menu in html is use the <details> tag, is you want to name it, use the summary tag
8th May 2022, 6:52 AM
Chris
Chris - avatar
27th Aug 2022, 4:37 AM
Angoshri Basak
Angoshri Basak - avatar
0
https://t.me/Coders_Crafters join our Telegram group for discussion with everyone about coding. Let's interact with all coders About programming language like HTML CSS, JS, PY
8th Oct 2023, 5:23 AM
Alison Pinto
Alison Pinto - avatar