0

HTML CSS Beginner Help

I'm a beginner with HTML and CSS. I briefly made a dropdown menu but it is kinda dirty? Just not neat. Could u help? (Sorry for my bad English) HTML : <!DOCTYPE html> <html> <head> <title>DropDown Menu</title> </head> <body> <div class = menu> <div class = ac> <button class = "812"> Our progress </button> </div> <div class = lower> <a href = "example.com"> LA </a> <a href = "example.com"> LB </a> <a href = "example.com"> LC </a> </div> </div> </body> </html> CSS : .menu{ position : relative; display : inline-block; } .ac{ background-color : #eaeaea ; border : 2px solid black ; padding : 13px ; cursor : default ; text-align : center ; font-size : 1.5em ; font-weight : 450 ; } .lower{ display : none; position : absolute; z-index : 1; } .lower a{ display : block; cursor : default ; font-size : 1.25em; text-decoration: none; color : black; padding : 35px; } .menu:hover .lower { display: block; } }

15th Jan 2025, 10:56 AM
Jammin
2 Antworten
+ 1
Just looking it over again I am wondering did you mean to set the font size 1.5em? Or did you mean 1.5rem. They are not tue same thing, rem is more common. Also, why are you setting the cursor if you want the default cursor? You would only set it to default if it was set to something else first which I don’t see you have done. Also, it’s a better idea to first try out your code to see if it works before asking if it is kinda dirty. Good luck on you’re coding journey!
15th Jan 2025, 11:45 PM
Zvi
Zvi - avatar
+ 1
All class names need “”. Class names shouldn’t start with a number There is an extra curly brace at the end
15th Jan 2025, 2:27 PM
Zvi
Zvi - avatar