One issue I'm facing is that the dropdown submenu of my navigation menu does not extend beyond its container element when displayed. My code includes main menu items (HOME, ABOUT, SERVICES, PRODUCTS, and CONTACT) along with submenu items (A, B, C, D, E) for each main menu item. However, the submenu items only appear below their respective main menu items when I increase the padding of the main menu items to ensure the background covers the submenu items. Otherwise, they are not visible. Here's a snippet of my code:
.menu{
width: 100%;
background: #d80000;
float: left;
margin-bottom: 50px;
display: block;
overflow: hidden;
padding: 10px 10px;
}
.menu .mainmenu{
margin-left: -40px;
/*display: none;*/
}
... (CSS and HTML code included here)
The desired outcome is for the submenu to drop down and display below the corresponding main menu item as we hover over them. However, this functionality is not working properly in the current code.