html - 如何删除 div 元素中的空白区域?

标签 html css twitter-bootstrap

我在这里提供了一个屏幕截图,我勾勒出了我想要折叠的区域,一直到最后一个蓝色按钮之后,触摸它。我用红色勾勒出我想塌陷的区域。是否有特定的类(class)可以让我这样做?

Collapse

代码:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="container">
  <div class="panel panel-primary col-md-6">
    <div class="row">
      <!-- Label -->
      <button type="button" class="btn btn-info btn-xs btn-block" id='invoicelabel'><strong>Invoice CP</strong>
      </button>

      <!-- Invoice CP -->
      <div class="btn-group btn-group-vertical col-md-3 test2">
        <button class="btn btn-primary btn-sm" type="submit">Total Amount</button>
        <button class="btn btn-primary btn-sm" type="submit">Duplicate</button>
        <button class="btn btn-primary btn-sm" type="submit">Clear</button>
        <button class="btn btn-primary btn-sm" type="submit">Currency</button>
        <button class="btn btn-primary btn-sm" type="submit" disabled>.</button>
        <button class="btn btn-primary btn-sm" type="submit" disabled>.</button>
      </div>
      <table class="table table-condensed">
        <tbody class="col-md-10 test pull-right">
          <tr>
            <td class="default" width="20%">
              <input type="text" class="btn btn-default btn-sm col-sm-12 floatright" placeholder="Pieces">
            </td>
            <td class="default" width="35%">
              <input type="text" class="btn btn-default btn-sm col-sm-12 floatright" placeholder="Unit Price">
            </td>
            <td class="default" width="45%">
              <input type="text" class="btn btn-default btn-sm col-sm-12 floatright" placeholder="Line Amount">
            </td>
          </tr>
          <tr>
            <td class="default" width="20%">
              <input type="text" class="btn btn-default btn-sm col-sm-12 floatright" placeholder="Pieces">
            </td>
            <td class="default" width="35%">
              <input type="text" class="btn btn-default btn-sm col-sm-12 floatright" placeholder="Unit Price">
            </td>
            <td class="default" width="45%">
              <input type="text" class="btn btn-default btn-sm col-sm-12 floatright" placeholder="Line Amount">
            </td>
          </tr>

        </tbody>
      </table>


    </div>
  </div>
</div>

最佳答案

尝试检查 .test.test2 的 CSS height 属性。可能它被设置为特定值。如果将其留空,该区域将适合内容。

关于html - 如何删除 div 元素中的空白区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42193478/

相关文章:

php - 图片上传脚本在实时服务器中不起作用,但在本地主机中起作用

jquery - Typeahead TypeError : it. toLowerCase 不是函数

javascript - 表单在 Bootstrap 模式表单内提交以执行appendTo html表

Silverlight for Mac 和 Silverlight 死了吗?

javascript - JQuery 图像 slider 使用 "Cycle Plugin": Why Won't My Images "Cycle"?

css - 仅当父元素是第一个元素时,如何将样式应用于父元素下的特定元素?

css - IE 中的丑陋文本

css - 删除 Bootstrap 布局中的间隙

html - ASP.NET TABLE + 在一个可滚动的 DIV 中,+ 表格单元格位置 :Relative : ModalPopupExtender

javascript - 页脚上的导航栏事件滚动