I am facing some issues with the navigation bar on my website. The position of the navigation bar shifts when the dropdown menu is displayed. Additionally, resizing the browser also causes changes in the navigation bar layout. This is not what I intended, so I would really appreciate it if someone could help me resolve this problem.
Below is the CSS code that I am currently using:
/*main menu*/
.nav-top {list-style:none;
}
ul.nav-top ul { margin-top:-40px; margin-bottom:-50px; margin-left:-21px; margin-right:-50;
position: relative; display:none; }
ul.nav-top li { display:inline-block;
padding:40px;
margin-right:19px;
position:relative;
}
ul.nav-top li:hover > ul { display:block; }
ul.nav-top li a { display:block;
text-decoration:none;
border-bottom: 2px solid transparent;
}
ul.nav-top a:hover{ color:#686A6A;
border-bottom:2px solid #E4E4E4;
}
/*sub menu*/
ul.nav-top ul ul { clear:both;
border: solid 1px ffffff; }
ul.nav-top li li {
display:block;
padding:2px; padding-top:10px;
}
ul.nav-top ul ul li {
}
ul.nav-top ul ul a{
white-space:nowrap;
}
ul.nav-top ul ul li:hover a{
text-decoration:none; background:#FFF;
}
ul.nav-top ul ul li:hover a:hover{
color:#686A6A; border-bottom:2px solid #E4E4E4;
}