Looking to create a horizontal menu with a responsive background image.
Struggling with the issue of the 'ul' menu being misaligned with the background image when in full-screen mode. Attempted to use separate 'div' containers for the image and menu, but it did not resolve the problem.
Additionally, resizing the window to its smallest size causes the menu to extend beyond the image bar.
Avoiding 'px' settings to ensure maximum responsiveness for the website.
Here is the HTML and CSS code:
.menu {
margin-top: 1%;
margin-left: auto;
margin-right: auto;
width: 100%;
height: 11vh;
background: url(../Images/menu.png) no-repeat;
background-size: 90% 10vh;
margin-bottom: 5%;
}
<body class="container">
<div class="menu">
<ul>
<li> foo1 </li>
<li> foo2
<ul>
<li> sub </li>
</ul>
</li>
<li> foo3 </li>
</ul>
</div>
</body>