我面临一个颇为着名的问题,但似乎找不到任何解决方案在我的情况。所以我在引导程序上实现了这个可折叠的可滚动条,但问题是当我尝试在移动设备上滚动此条时,由于搜索栏从边栏的100%高度设置了一些空间,滚动条未达到结尾的div因此裁剪的内容。我想知道一种方法来排除高度栏或像解决此问题的解决方法。移动Chrome栏占用100%高度的空间css
这是我的HTML和CSS的侧边栏:https://jsfiddle.net/fq5b3m1w/
html,
body {
background: #f8f8f8;
}
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
padding-top: 50px;
}
#wrapper.toggled {
// padding-left: 100px;
}
#sidebar-wrapper {
z-index: 99999;
position: fixed;
left: 100px;
width: 0;
height: calc(100%);
margin-left: -100px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
background: #fcfcfc;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 100px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 5px;
background: #f8f8f8;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -100px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 100px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
// text-indent: 20px;
// line-height: 25px;
text-align: center;
margin: 0 0;
}
.sidebar-nav li .fa {
padding-top: 10px;
display: block;
// color: rgba(2,136,209,1);
}
.sidebar-nav li.active a {
// color: #fff;
background: rgba(2, 136, 209, .2);
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #000;
transition: all .2s;
font-size: 14px;
padding: 8px 0;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #333;
background: rgba(2, 136, 209, 0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
color: #333;
background: rgba(2, 136, 209, 0.2);
}
.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: #fff;
background: none;
}
@media(min-width:992px) {
#wrapper {
padding-left: 100px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 100px;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
这种有用,但地址栏消失后,侧边栏下创建一个50px的空间 –