2016-01-20 113 views
0

我有一個渲染較低的方塊,我無法弄清楚爲什麼。強制元素向上移動

enter image description here

<div id="hint-history" class="popup"> 
<div class="row"> 
    <div class="col" id="closehistorypopup"> 

     <div class="body"> 

      <button class="x"> 
       <span class="sprite close"></span> 
      </button> 

      <div class="title">Hint History</div> 

      <div class="lists"> 
       <?php for($i=0;$i<6;$i++) { ?> 
        <div class="list history[[$i]]" id="history[[$i]]"> 
         <div class="info"> 
          <div class="picture monophoto"> 
           <div class="text">BO</div> 
           <div class="img" style="background-image: url();"></div> 
          </div> 
          <div class="right"> 
           <div class="lineone">John Smith</div> 
           <div class="linetwo">Daily Essentials</div> 
          </div> 
         </div> 
         <div class="boxes"> 
          <div class="left"> 
           <div class="box box1"></div> 
          </div> 
          <div class="right"> 
           <div class="box box2"></div> 
           <div class="box box3"></div> 
          </div> 
         </div> 
         <a class="cbutton whiteonblack">VIEW LIST<!--SEE <span class="owner">JOHN'S</span>--></a> 
        </div> 
       <?php } ?> 
       <?php $i++; $privateCount = 1; ?> 
       @if ($privateCount > 0) 
        <div id="privatecard" class="list history[[$i]]"> 
         <div class="info"> 
          <div class="picture monophoto" style="visibility: hidden;"> 
          </div> 
          <div class="right"> 
           <p id="privatecounter">       
            @if ($privateCount == 1) 
             There is [[$privateCount]] private user. 
            @else 
             There are [[$privateCount]] private users. 
            @endif 
           </p> 
           <div class="linetwo">&nbsp;</div> 
           <div class="linetwo">&nbsp;</div> 
           <div class="linetwo">&nbsp;</div> 
          </div> 
         </div> 
         <div class="boxes"> 
          <div class="left"> 
          </div> 
          <div class="right"> 
          </div> 
         </div> 
        </div> 
       @endif 
      </div> 

不管我做什麼,它不會讓步。

.privatecard { 
    margin-top: -500px !important; 
} 
.privatecard { 
    padding-bottom: 500px !important; 
} 

//etc 

我該如何強制它向上移動?

+0

請問您是否可以爲相關元素包含所有相關的CSS?不僅僅是你嘗試過的CSS。 – zgood

回答

1

發表小提琴?

雖然我曾經遇到過這個問題,但我已經通過確保所有inline-block元素也是vertical-align:top;(或任何其他狀態,只要它們都一致)的組合來解決它。然後,將min-height設置爲父容器,並將min-height設置爲所有inline-block'd元素