css3 - Bootstrap layout - Adjust column width to its content -


i trying make column's width equal size of text inside.

html:

<div class="row">   <div class="col-sm-2 container" >     <span>case number</span>   </div> </div> 

css:

.container {    background: #ddd;    display: inline-block; } 

fiddle

it seems height ok not width. help.

new fiddle cannot remove gutters

use this:

    <div class="col-sm-2 container" >         <span>case number</span>     </div> </div>  <style type=text/css>     .container {         background: #ddd;         display: inline-block;         padding:0px;     } </style> 

Comments