I'm using php to generate a menu from a mysql database. In my design it's not possible to use a html table so I use an unnumbered list . Now i have 3 vars: dishname, short_description and the price.
Between the [dishname (short_description)].................[price] need to be flexible dots;
In this screenshot you can see what I have now:
html:
<ul>
<li class=dish>
<div>
<a class=dish>...</a>
<span class=short>...</span>
</div>
<span class=price>..€</span>
</li>
</ul>
css:
ul.submenu li{ line-height:1.6rem; margin-left: 2rem; list-style-type: circle; text-transform: lowercase; width: 100%;}
li.dish{ display: flex; justify-content: space-between; }
li.dish span.short::after{ position: absolute; z-index: -1; content: "....................................................................................................................................";}
span.short{ font-size: 0.8rem; font-style: italic;}
span.price{ font-size: 1rem; }
In the screenshot you can see what the problem is, the "................." should be clipped or responsive to the available space in the width. There should be no dots visible after the price.