<body>
<div id="Wrapper">
<div id="Header_Wrapper">
<div id="Menu_Wrapper">
<?php include( 'menu.php');?>
</div>
<div id="GuardSpace_Wrapper"></div>
</div>
<div id="Content_Wrapper">
<div class="row">
<div class="col-lg-2 col-xs-12 col-sm-2 ">
<div id="AdminLeftMenu">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Menu 1</a></li>
<li><a href="#">Menu 2</a></li>
<li><a href="#">Menu 3</a></li>
</ul>
</div>
</div>
<div class="col-lg-8 col-xs-12 col-sm-8 ">
<div id="Content">
<?php include($page_content);?>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</div>
<div class="col-lg-2 col-xs-12 col-sm-2 ">
<div id="AdminRightMenu">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Menu 1</a></li>
<li><a href="#">Menu 2</a></li>
<li><a href="#">Menu 3</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="Footer_Wrapper">
<?php include( 'footer.php');?>
</div>
</div>
a
</body>
html, body {
height: 100%;
width: 100%;
margin: 0;
}
#Wrapper {
height: 100%;
width: 100%;
background: #fff;
}
#Header_Wrapper {
position:relative;
height:20%;
width: 100%;
background: #089de3;
float:left;
}
#Menu_Wrapper {
height:80%;
width: 100%;
}
#GuardSpace_Wrapper {
height:20%;
width: 100%;
background: #f5f5f5;
}
#Content_Wrapper {
position:relative;
height:60%;
width: 100%;
background: #fff;
float:left;
-webkit-box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
}
#Footer_Wrapper {
position:relative;
bottom:0;
height:20%;
width: 100%;
background: #333;
float:left;
}
#AdminLeftMenu{
width:100%;
height:100%;
}
#AdminRightMenu{
width:100%;
height:100%;
}
FIDDLE 当页面的网格大小小于720px或480像素时。页脚显示在Content_Wrapper上方。网格大小小于720px的包装高度小于子元素的总高度。是否有任何方式使内容适合< / p>
答案 0 :(得分:1)
#Content_Wrapper {
overflow:hidden;
min-height:60%;
width: 100%;
background: #fff;
float:left;
-webkit-box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
}
...“溢出:隐藏”是那里的关键。 “高度”改为“最小高度”只是因为否则内容不适合。
#Content_Wrapper {
height:60%;
width: 100%;
overflow-y:auto;
overflow-x:hidden;
background: #fff;
float:left;
-webkit-box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
box-shadow: -4px 8px 31px 5px rgba(0, 0, 0, 0.75);
}
答案 1 :(得分:1)
更改以下css:
#wrapper
,请移除height
并设置min-height:100%height
移除#Content_Wrapper
,然后设置margin-bottom:50px
更新了JSFiddle:https://jsfiddle.net/mpsingh2003/8878jma4/5/
关于如何放置页脚http://cssreset.com/how-to-keep-footer-at-bottom-of-page-with-css/