【问题标题】:MDBootstrap Messenger Like gridMDBootstrap Messenger 像网格
【发布时间】:2018-04-12 02:32:39
【问题描述】:

我想使用 bootstrap 4 创建一个类似于网格布局的信使

我的html如下

`<div class="container-fluid">
   <div class="row">
     <div class="col-md-3">here is a ul of list of contacts</div>
     <div class="col-md-9 ml-auto">msgs display here</div>
     <div class="col-md-9 fixed-bottom ml-auto">textarea here</div>
   </div> 
 </div>`

我希望msgs display here div 从页面顶部开始,直到到达文本区域div 问题是,它始终具有与第一个.col-md-3 相同的高度。

如何使中间 div .col-md-9 的高度独立于左侧?当然还要保持响应。

干杯,

【问题讨论】:

    标签: html css mdbootstrap


    【解决方案1】:

    我假设(因为我看不到您的 CSS)您声明了行 div 的高度。这使得所有元素具有相同的高度。为每个元素创建一个 ID 并在您的 CSS 中调用它们,例如):

    #msg-display-here {
    
      /* height goes here */
    
    }
    

    并且您在 html 中的 div 应该有一个 ID,因为您有 2 个相同的类:

    <div id="msg-display-here" class="col-md-9 ml-auto">msgs display here</div>
    

    【讨论】:

    • 另外请发布您的 CSS
    • 除了mdboostrap library之外我没有添加任何css
    • 另外,当我按照您的回答定义height 时,它确实有效,只是现在它没有响应
    • 您可能正在以像素为单位制作高度。如果您有参考像素数,请将其设为百分比或 rem。另外,你是怎么做到的,没有 CSS
    • 会试一试。阅读您的帖子后,我只是内联了要测试的高度。目前还没有自定义 css
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多