dtgr3392 2017-02-02 06:38
浏览 130

DIV容器没有高度

I have the following CSS which makes images break row after it reaches the end of the DIV but the DIV container behind it is not taking height according to the images. The height should expand along with the images. Here is the screenshot http://prnt.sc/e3fqvr.

CSS:

.image-container {
    width: 163px;
    height: 100px;
    padding: 0px 0px 65px 0px;
    font-size: 12px;
    text-align: center;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    margin-right: 13px;
    display: inline-block;
    float: left;
}

.proof-container {
    width: 100%;
    position: absolute;
}

.container {
    width: 100%;
    min-height: 500px;
}

.container-inside {
    border: 1px solid #1df2f2;
    width: 100%;
    border-radius: 5px;
    margin-top: 10px;   
    padding: 20px;
    box-sizing: border-box;
}

HTML:

<div class="container">
    <div class="container-inside">
      <div class="container-title">Images</div>
      <br>
      <div class="proof-container">
        <?php while($faf = $prooq->fetch()){ extract($faf); ?>
        <div class="image-container"> <img class="myThumb" id="myImg" src="https://wallpaperstock.net/wallpapers/thumbs1/45957hd.jpg" alt="" width="160" height="100">
          <div class="image-text">shreyansh ($8.75)<br>
            <span><?php echo date('jS M, Y (h:i a)', strtotime($pr_uptime)); ?></span></div>
        </div>
        <div id="myModal" class="modal"> <span class="close">&times;</span> <img class="modal-content" id="modalImg">
          <div id="caption"></div>
        </div>
        <?php } ?>
      </div>
    </div>
  </div>

Please help me devs.

  • 写回答

4条回答 默认 最新

  • dousao8152 2017-02-02 06:51
    关注

    Try to remove css property

     position:absolute from proof-container
    

    And add

    overflow:hidden to .container-inside div
    
    评论

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统