Is there a way to create a CSS horizontal menu bar where the <a>
elements collectively expand to fill the parent's width? Here is an example of the HTML structure:
<div id="parent">
<a href="/">Home</a>
<a href="/learn">Learn More About The Product</a>
<a href="/about">About Us</a>
<a href="/contact">Contact Us</a>
</div>
The goal is for each <a>
element to occupy a certain percentage of the total width so that "Home" aligns with the left edge and "Contact Us" aligns with the right edge of the parent. Since "Learn More About The Product" is longer, simply dividing the width equally among the four links won't work. Any suggestions on how to achieve this?