我的垂直菜单栏的高度与页面其余部分相同,但出现问题。将菜单栏高度设置为整页高度
所以我有这样的
<div id="header">Site title etc</div>
<div id="pagecontent">
<div id="menubar">Menu buttons<div>
<div id="pageinnercontent">Contents of the page</div>
</div>
有了这个CSS:
html {
min-height: 100%;
}
body {
min-height: 100%;
}
#pagecontent{
position: absolute;
width: 100%;
min-height: 100%;
}
#menubar{
height: 100%;
position: absolute;
width: 170px;
background-color: #404040;
color: white;
float: left;
bottom: 0;
}
#pageinnercontent{
width: calc(100% - 170px);
left: 170px;
position: absolute;
}
但是,它不工作。当pageinnercontent的内容比菜单“更长”时,菜单不会变长。请帮忙。
适合我。检查你的HTML的结构。 –