This is a follow-up from: Using dot leaders for a food menu with bootstrap grids
I'm creating a food menu using the grid column system with bootstrap 3, and I've created dot leaders between the menu item and the price. Thanks to user LGSon I'm using
display:flex;
Which is doing the trick, however now the word margin seems to be cutting off the dot leaders differently depending on how many words there are. One word there is no cut off, after that there seems to be around 10px (These are approximated, and not exact). My goal is to make the dot leaders completely uniform and even. Here's what the image:
Here's my code. My apologies if it's too long, I tried to keep it brief. If anyone could help I would appreciate it.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class=" col-xs-6 ">
<p class="item dots">Cheese</p>
<p class="item dots">White</p>
<p class="item dots">Special</p>
<p class="item dots">Whole Wheat</p>
<p class="item dots">Silician</p>
<p class="item dots">Silician Special</p>
<p class="item dots">Chicago Style</p>
</div>
<div class="col-xs-2">
<p class="item">$8.99</p>
<p class="item">$9.99</p>
<p class="item">$13.50</p>
<p class="item">$13.50</p>
<p class="item">$13.50</p>
<p class="item">$13.50</p>
<p class="item">$13.50</p>
</div>
<div class="col-xs-2">
<p class="item">$11.99</p>
<p class="item">$12.99</p>
<p class="item">$15.99</p>
<p class="item">$12.99</p>
<p class="item">$12.99</p>
<p class="item">$12.99</p>
<p class="item">$12.99</p>
</div>
<div class="col-xs-2">
<p class="item">$12.99</p>
<p class="item">$13.99</p>
<p class="item">$17.99</p>
<p class="item">$13.99</p>
<p class="item">$15.99</p>
<p class="item">$20.00</p>
<p class="item">$14.99</p>
</div>
</div>
</div>
<style>
.dots {
display: flex;
}
.dots::after {
white-space: nowrap;
overflow: hidden;
direction: rtl;
content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ."
}
</style>
<!-- Matches Height in between divs--><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.0/jquery.matchHeight-min.js">
$(function() {
$('.item').matchHeight(false);
//Make links '.active' in Handlebars
var url = window.location.href;
$('nav li').find('.active').removeClass('active');
$('nav li a').filter(function(){
return this.href == url;
}).parent().addClass('active');
});
</script>