The best decision:
<ul>
<li><p class="food">Chinese Food</p><p class="price">$5.99</p></li>
</ul>
then CSS to match (untested, but customizable to get the effect)
li {
width: 300px;
height: 20px;
border-bottom: 1px dotted black;
background-color: white;
}
.food, .price {
height: 22px;
background-color: white;
}
.food {
float: left;
}
.price {
float: right;
}
Thus, it basically fixes the LI rectangle and draws a border from below, then the price and product name cover it dynamically with their width. YMMV with browsers, but perhaps a negative bottom border — will the border get the border border, probably obscured by P.
source
share