css - 为 Bootstrap 列表组元素制作页眉/页脚的好方法是什么?

标签 css twitter-bootstrap twitter-bootstrap-3

我希望能够将自己的自定义页眉、页脚等添加到列表组元素中。我确信有一种简单的方法可以做到这一点,但我的 CSS 技能低于标准。谁能告诉我解决我的尝试的好方法? https://jsfiddle.net/r6xt1rnz/36/

我希望能够将内容插入到以下部分中,并让它们各自占据列表组元素的 33%。

<li class="list-group-item">
    <div class="list-header row">
      This is the header
    </div>
    <div class="list-content row">
      This is the content
    </div>
    <div class="list-footer row">
      This is the footer
    </div>
  </li>

谢谢!

最佳答案

如果你想有百分比的垂直高度,你需要使用下面的代码:

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
}

这样,您可以按百分比控制高度。非常不鼓励使用这种方法,它不能与 bootstrap 等框架一起使用。但是您可以尝试添加包装器:

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
}

.first-top {
  height: 30%;
  background: #ccf;
}
.middle-top {
  height: 40%;
  background: #cfc;
}
<div class="first-top">
  <!-- Give the list items here. -->
</div>
<div class="middle-top"></div>
<div class="first-top"></div>

关于css - 为 Bootstrap 列表组元素制作页眉/页脚的好方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41423074/

相关文章:

css - Chrome 中的小宽度

html - 隐藏选择元素的文本部分

twitter-bootstrap - Bootstrap @media 并在屏幕尺寸上更改 css

javascript - 同一页面上两个js库的js冲突

javascript - THREE.js 多个渲染器都动态调整大小

html - 悬停下拉菜单出现在左侧而不是直接位于链接 anchor 下方

javascript - 单击或悬停/焦点时更改 Bootstrap 按钮颜色和类别

css - 更改移动布局上的 Bootstrap 列/行顺序?

twitter-bootstrap - 每个按钮组有多个下拉菜单?

css - 带悬停的菜单,如何在移动设备上工作?