I am currently working on developing a restaurant's website. I have been tasked with incorporating a dotted line infill between each menu item and its corresponding price. Despite spending a considerable amount of time searching online and testing different methods using CSS, I have yet to discover a suitable solution. While I have come across several alternatives that are effective when a solid color background is in use, the website I am working on features a background image, rendering those solutions impractical.
For instance, this menu style solution on Stack Overflow suggests setting the background colors of the menu item and price to white to conceal the dotted lines. However, this approach is not viable for a background image scenario.
Despite experimenting with various CSS display attributes, including table-row and table-cell, as well as adjusting the width settings for different elements, I have been unable to achieve the desired outcome.
Below is a fictional sample markup that I have been working with:
<ul>
<li><span>Soup</span><span class="dots"> </span><span>$2.99</span></li>
<li><span>Ice cream</span><span class="dots"> </span><span>$5.99</span></li>
<li><span>Steak</span><span class="dots"> </span><span>$20.99</span></li>
</ul>
I have attempted using the "dots" class element with a bottom border to bridge the gap, but my efforts have been fruitless. I also experimented with adding a bottom border to the LI element extending across each row, but this does not align with the designer's vision. As a last resort, I may have to resort to utilizing JavaScript or revert to using tables, though I would prefer to avoid these options if possible.
I would greatly appreciate any insights or suggestions you may have. Thank you!