html - fill out white space with a line -


how can create underline fills white space between end of text line , end of div's width.

i'm trying following:

i want product line break when screen gets smaller. want price stay lined out right , underlined. white space between last word (mayo) , price must automatically filled underline.

big screen:
old cheese – salad, avocado, egg, herbal mayo......................500

smaller screen:
old cheese – salad, avocado, egg,
herbal mayo..........................................500

extra small screen:
old cheese – salad,
avocado, egg, herbal
mayo...........................500

i have following markup:

html

<div class="productline">   <div class="product">     old cheese – salad, avocado, egg, herbal mayo   </div>   <div class="line">&nbsp</div>   <div class="price">500</div> </div> 

css

.productline {     width:300px; } .product {     display:table-cell;         white-space: nowrap; } .line {     border-bottom: 1px solid black;     display: table-cell;     width:100%; } .price {     border-bottom:1px solid black;     display: table-cell;     white-space: nowrap;     vertical-align:bottom; } 

example

http://jsfiddle.net/florisvl/zv6yd/

fix

http://jsfiddle.net/florisvl/3b7tr/

it's bit of trick, works (at least tested in ff):

http://jsfiddle.net/dvtcc/

html:

<table>     <tr>         <td>             <span>                 old cheese – salad, avocado, egg, herbal mayo             </span>         </td>         <td class="price">             <span>                 500             </span>         </td>     </tr> </table> 

css:

table{     border-collapse: collapse;     width: 100%; }  td{     border-bottom: 3px dotted black;     vertical-align: bottom;     padding: 0; }  td.price{     text-align: right; }  td > span{     background-color: white;     position: relative;     bottom: -5px; } 

the tricks dotted border spans entire bottom of row, spans positioned cover border directly below them.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -