我是 Bootstrap 的新手,在理解网格系统的工作原理方面有一点问题。最初,我为带有侧边栏的页面提供以下代码:
<div class="row">
<div class="sidebar col-xs-3">
<div class="well">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="#">
Navigation
</a>
</li>
<li>
<a href="#">Item 1</a>
</li>
<li>
<a href="#">Item 2</a>
</li>
<li>
<a href="#">Item 3</a>
</li>
<li>
<a href="#">Item 4</a>
</li>
<li>
<a href="#">Item 5</a>
</li>
<li>
<a href="#">Item 6</a>
</li>
<li>
<a href="#">Item 7</a>
</li>
</ul>
</div>
</div>
<div class= "main col-xs-9">
<div class="well">body</div>
</div>
</div>
使用以下CSS:
/* Sidebar Styles */
.sidebar-nav {
top: 0;
width: 250px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #000;
background: rgba(255,255,255,0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav > .sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
}
.sidebar-nav > .sidebar-brand a {
color: #999999;
}
.sidebar-nav > .sidebar-brand a:hover {
color: #000;
background: none;
}
我非常感谢任何关于为什么侧边栏文本没有调整到侧边栏区域的大小的解释?谢谢你的帮助。