Your current challenge seems to revolve mainly around box positioning. It is crucial to always define the position of your content when utilizing absolute
positioning. This will prevent your submenu from appearing haphazardly and ensure it stays precisely where you intend it to be. Additionally, ensure that the parent element has a relative
position to allow the submenu to inherit box properties from it.
.firstlevel-menu-item {
position: relative;
}
.my-submenu {
position: absolute;
top: 100%; /* 100% of firstlevel menu's height */
left: 0; /* align to firstlevel menu's left side */
width: 100%; /* width of firstlevel menu */
}
Aligning the content with the end of the parent's box should address your problem effectively.
Here is a helpful JSFiddle link for further reference.
I recommend delving deeper into box positioning, as it is crucial for creating dropdown menus and various other features that rely on absolute/relative positioning.