我想在 Bootstrap 中有一个可折叠的侧边栏。
为此,我希望在内容和侧边栏之间有一个 slim 元素来切换侧边栏的可见性(display
属性)。请参见下面的示例:
https://jsfiddle.net/zaao8Lqb/1/
我想要一个元素而不是边框(如 fiddle 中所示)。我该怎么做?
最佳答案
解决方案是一个简单的全高 div。可折叠侧边栏的整体解决方案:
https://jsfiddle.net/c2bgkbzL/1/
html,
body {
height: 100%;
}
.fill {
height: 100%;
min-height: 100%;
}
#content {
background-color: AliceBlue;
height: 100%;
padding-left: 0;
}
#sidebar {
background-color: DarkGray;
height: 100%;
padding: 3px;
}
#collapseme{
background-color: black;
width: 10px;
height: 100%;
float: left;
}
关于html - Bootstrap : slim vertical element with full height,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35893360/