2016-03-04 41 views
3

我有我的代碼小提琴這裏:https://jsfiddle.net/grqdpeyh/放置在一個div幾個div的和不斷變化的大小

.scoreboard{ 
margin-left: 70%; 
position: absolute; 
padding-top: 1%; 
} 

.sc_place{ 
    height: 42px; 
} 

有五個格與類sc_place,我需要他們的軌道線之間是。背景div(軌道)在窗口大小調整時自動調整大小。 我設法讓馬匹的軌道重新調整大小,但不能和sc_place div一樣。

順便說一句,我用我的主網站引導,如果這有助於任何事情。

- 編輯 -

這是我的中間區域的全碼:

<div class="col-md-7"> 
     <div class="panel panel-default"> 
      <div class="panel-body"> 

       <!-- PROGRESS --> 

       <div class="progress text-center" style="height:30px"> 
        <span id = "pbanner"></span> 
        <div class="progress-bar progress-bar-info progress-bar-striped" id="timebar" style="width:100%"></div> 
       </div> 

       <img class="img-responsive center-block" src="img/track/top.jpg"></img> 
       <!--<img class="img-responsive center-block" src="img/track/main.jpg"></img>--> 
       <div class="maintrack"> 
        <div class="horse" style="margin-top: -8%;"></div> 
        <div class="horse" style="margin-top: -4%;"></div> 
        <div class="horse" style="margin-top: 0%;"></div> 
        <div class="horse" style="margin-top: 5%;"></div> 
        <div class="horse" style="margin-top: 9%;"></div> 

        <div class="scoreboard"> 
         <div class="sc_place text-center">TEXT</div> 
         <div class="sc_place text-center">TEXT</div> 
         <div class="sc_place text-center">TEXT</div> 
         <div class="sc_place text-center">TEXT</div> 
         <div class="sc_place text-center">TEXT</div> 
        </div> 
       </div> 
       </div> 
       </div> 
       </div> 

完全小提琴:https://jsfiddle.net/grqdpeyh/8/

但我不認爲這真的很重要,但。

+0

你能不能更新提琴? –

+0

是的,我更新了它。 – Nedas

+1

這應該爲你工作:https://jsfiddle.net/arpit_goyal/x0gtqa8y/ –

回答

4

試試這個CSS的.sc_place

.sc_place{ 
    height:5vw; 
    font-size:3vw; 
} 
//in case of image in place of font this can be replace with font-size 
background: url(http://buruburu.gr/wp-content/uploads/some_pigeons_are_more_equal_than_others/some_pigeons_are_more_equal_than_others_01.jpg) no-repeat contain; 

或者看看這個:https://jsfiddle.net/arpit_goyal/x0gtqa8y/

+0

這不工作不幸。 – Nedas

+0

@NedasMikoleika https://jsfiddle.net/arpit_goyal/sj4k8765/檢查這個,爲我工作 –

+0

@NedasMikoleika這個作品,你在這裏得到的想法,只是調整你的願望的大衆價值。那麼mediaquerie可以用來避免字體大小太小... –