[英]How to make a div 100% height
大家好,首先對您已經提出了很多次的問題深表歉意。 原諒我說我無法找到與我的代碼匹配並與我的代碼一起工作的答案,這就是為什么我問:)
好吧,我想使側邊欄div的高度為100%,而不僅僅是調整div內的內容,我該怎么做?
這是我的代碼:
html, body {
margin: 0px;
height:100%;
min-height:100%;
}
.SideMenu {
height:100%;
float:left;
background-color:#ACB9B1;
width:20%;
margin:0;
overflow-y:hidden;
overflow-x:hidden;
}
http://jsfiddle.net/u9r7zeyk/此處顯示為全高,不知道為什么?
嘗試這個:
html, body {
height:100%;
}
.SideMenu {
height:100%;
background-color:#ACB9B1;
width:20%;
}
編輯,這里你去。 我想這就是你想要的。
html, body {
margin: 0px;
}
.SideMenu {
position:absolute;
height:100%;
float:left;
background-color:#ACB9B1;
width:20%;
margin:0;
overflow-y:hidden;
overflow-x:hidden;
}
您好,謝謝您的輸入,我在這里可以看到:
.menu{
background-color:#ACB9B1;
width: 200px;
position: fixed;
top: 0px;
left: 0px;
bottom: 0px;
}
.menu li a {
display:block;
text-decoration: none;
color: #fff;
line-height: 1.5;
margin-left:5%;
color:#A92432;
}
.menu li {
width: 100%;
height: 30px;
font-family: 'Open Sans';
border-bottom: 1px solid #A92432;;
font-size:18px;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.