I'm trying to figure out how to automatically fill space between two objects. I have menu items and prices.
The goal is something like this:
Burger..........................$9.99
Steak and Potato.........$14.99
Mac and Cheese.........$6.99
The spacing between menu item and price should be the same. Users can enter the menu item and price and I need to fill in any space.
This is what I've tried but it doesn't quite work:
.inLine {
display: inline-block;
}
<h1 class='inLine menuItem'> Burger </h1>
<span class='inLine dots'> .....................</span>
<h3 class='inLine price'> $9.99 </h3>
<br>
<h1 class='inLine menuItem'> Steak </h1>
<span class='inLine dots'> .....................</span>
<h3 class='inLine price'> $14.99 </h3>
<h1 class='inLine menuItem'> Mediterranean Chopped Salad </h1>
<span class='inLine dots'> .....................</span>
<h3 class='inLine price'> $14.99 </h3>
The issue is the dots need to take up the correct amount of space regardless of how long the item name is. I've tried setting the dots to width: 100%
but that does not seem to do it. Any ideas?