css - Text align doesnt work with span -


i need below alignment.i can achieve using table want solution without using table.

  sub total  $596.00    shipping  $35.00         tax  $63.11 order total  $694.11 

when dont use table looks below though use text-align:right first span element.

sub total    $596.00 shipping     $35.00 tax          $63.11 order total  $694.11 

you use inline-block , first-child align , add padding.

something this:

#container > div > div {      display:inline-block;      min-width:75px;  }    #container > div > div:first-child {      text-align:right;      padding-right:10px;  }
<div id="container">      <div>          <div>sub total</div>          <div>$596.00</div>      </div>      <div>          <div>shipping</div>          <div>$35.00</div>      </div>      <div>          <div>tax</div>          <div>$63.11</div>      </div>      <div>          <div>order total</div>          <div>$694.11</div>      </div>  </div>


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -