html - Increase DIV width by float elements -


i want make div auto increase width. have tried it's not working: problem?

http://jsfiddle.net/silverlight/b6k8x/1/

html:

<div class="metro">   <div class="rail">     <div class="track">a</div>     <div class="track">b</div>     <div class="track">c</div>   </div> </div> 

css:

.metro{   position       :relative;   background     :rgba(255, 255, 255, .03);   width          :150px;   height         :128px;   padding-bottom :28px;   overflow       :hidden;   overflow-x     :scroll;   } .metro .rail{     white-space:nowrap;   position   :relative;   width      :auto;   background :rgba(255, 255, 205, .03);   height     :128px;   min-height :128px;   overflow-y :hidden;   } .metro .rail .track{   text-align:center;   display    :inline-block;   float        :left;   margin-right :10px;   width        :64px;   height       :128px;   background   :rgba(255, 105, 255, .3);   } 

you shouldn't limit width of metro class: http://jsfiddle.net/b6k8x/2/

.metro{ position       :relative; background     :rgba(255, 255, 255, .03); height         :128px; padding-bottom :28px; overflow       :hidden; overflow-x     :scroll; } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -