我发现这个Facebook的时间线看起来像我不能得到ul的高度
<ul class="timeline">...</ul>
100%高度,以便当内容较少时,中间的线条填充页面高度。
我正在尝试让以下'line'填充页面的其余部分。
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #eeeeee;
left: 50%;
margin-left: -1.5px;
}
添加'身高:100%;'到.timeline不起作用。
我创造了一个小提琴: http://jsfiddle.net/4EJNt/1/
答案 0 :(得分:0)
问题是您的.container
元素不在height:100%
,因此当您尝试将height:100%
属性添加到<ul>
元素时,技术上是 填充所有可用空间,只是您的.container
元素与<ul>
元素的高度相同。
至少在你的小提琴中,你的body
标签也与.container
元素的高度相同。尝试将这些样式添加到您的小提琴中,您将看到我的意思:
html, body, .container, ul.timeline
{
height:100%;
}
答案 1 :(得分:0)
将以下内容添加到CSS中,bootstrap.css文件中存在过多的边距。
div.container > div.page-header {
margin-bottom:0px;
}
这是一个小提琴 http://jsfiddle.net/4EJNt/4/