我想用自己的側邊欄和主要內容在引導程序中創建佈局。我現在用的是下面的HTML的時刻(也this jsFiddle):如何在使用引導程序的網格時使列使用其父母高度的100%?
<!DOCTYPE html>
<html>
<head>
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" media="screen" rel="stylesheet" type="text/css" />
<style type="text/css">
#sidebar {
background-color: lightgreen;
}
#footer {
background-color: lightblue;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="span4">
<div id="sidebar">
<ul>
<li><a href="http://www....">Home</a></li>
<li><a href="http://www..../faq">Questions</a></li>
<li><a href="http://www..../news">News</a></li>
<li><a href="http://www..../contact">Contact</a></li>
</ul>
</div>
</div>
<div class="span8" id="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean in purus purus.
Ut risus lorem, pharetra nec iaculis sit amet, blandit nec turpis.
Aliquam dapibus orci ac sem viverra semper cursus ante varius.
Vestibulum iaculis eleifend magna, sit amet blandit nibh dignissim pellentesque.
Etiam suscipit accumsan tincidunt.
Sed auctor, orci at pretium commodo, enim dui fermentum nulla, id blandit enim lacus non mi.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean in purus purus.
Ut risus lorem, pharetra nec iaculis sit amet, blandit nec turpis.
Aliquam dapibus orci ac sem viverra semper cursus ante varius.
Vestibulum iaculis eleifend magna, sit amet blandit nibh dignissim pellentesque.
Etiam suscipit accumsan tincidunt.
Sed auctor, orci at pretium commodo, enim dui fermentum nulla, id blandit enim lacus non mi.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
</p>
</div>
</div>
<div class="row">
<div class="span12" id="footer">
Footer
</div>
</div>
</div>
</body>
</html>
我想是這樣的:
我所得到的卻是這樣的:
我能做些什麼來讓邊欄div一路走下去?理想情況下,不改變HTML(只有CSS變化),但如果這是不可能的,我會採取任何事情。
這個答案可能會幫助:http://stackoverflow.com/a/8741070/681807 –
@MyHeadHurts:可惜是t echnique似乎不能在頁腳存在的情況下工作 - 側欄會延伸到屏幕的末尾,而不是使用該代碼的頁腳。 –