我很难解决这个问题,虽然它一定很简单......
我的页面上有一个包含其他 div 元素的 div 包装器。margin-top
所有都使用in对齐px
;但最后一个(页脚)我需要它margin-bottom:0px
,以便它显示在包装器的底部,但这不起作用:页脚始终显示在页面顶部。
我在这里讨论了其他对齐问题,尝试给position: absolute
页脚和position:relative
包装器;没用。我也尝试使用 % heights 和 min-height ......但仍然是顶部的页脚
我对此感到有点沮丧:(
CSS:
body {
margin: 0px;
background-repeat: repeat;
background-image: url(images/modulo-pattern-grey-light.gif);
}
#body-quienes {
height: 800px;
}
#pagina {
height: 720px;
margin: 0 auto;
background: #fff url(images/footer.gif) left bottom no-repeat;
width: 980px;
box-shadow: 4px 4px 5px #999;
}
.header {
position: absolute;
margin-top: 0px;
margin-bottom: 0 px;
margin-right: auto;
margin-left: auto;
height: 70px;
width: 980px;
margin: 0px;
background-image: url(images/header.gif);
}
.menu_container{
position: absolute;
float: left;
width: 270px;
margin-top: 220px;
}
.main_menu ul {
padding: 0px;
margin:0px;
list-style-type: none;
}
.main_menu ul li {
font-family:Arial, Helvetica, sans-serif;
text-transform: uppercase;
font-size:11px;
letter-spacing:4px;
text-align:right;
line-height:35px;
list-style-type:none;
}
.main_menu ul li a {
padding-right: 25px;
text-decoration:none;
color:#999;
display: inline-block;
}
.main_menu ul li a.selected {
color: #bc4c9b;
font-weight:bold;
background: url(images/circle.gif) right center no-repeat;
}
.main_menu ul li a:hover {
text-decoration:none;
color:#999;
font-weight:bold;
background:url(images/circle_grey.gif) right center no-repeat;
}
.quienes_pic{
position: absolute;
height: 259px;
width: 174px;
margin-left: 306px;
margin-top: 230px;
background-image: url(images/san.jpg);
}
.quienes_text{
position: absolute;
padding-left: 25px;
border-left: 2px dotted #ccc;
width: 395px;
height: 360px;
margin-left: 510px;
margin-top: 230px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color: #bc4c9b;
line-height:20px;
content-left-padding: 25px;
}
.footer {
position:absolute;
margin-bottom: 0px;
margin-left: 490px;
width: 460px;
height: 98px;
margin-right: 30px;
background-color: #bc4c9b;
}
HTML:
<body id="body-quienes">
<div id="pagina">
<div class="header"></div>
<div class="logo"></div>
<div class="flashanim"></div>
<div class="menu_container">
<div class="main_menu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a class="selected" >Quiénes Somos</a></li>
<li><a href="consultoria.html">Consultoría</a></li>
<li><a href="capacitacion.html">Capacitación</a></li>
<li><a href="academico.html">Académico / Artículos</a></li>
<li><a href="alianzas.html">Alianzas</a></li>
<li><a href="proyectos.html">Proyectos</a></li>
<li><a href="contacto.html">Contacto</a></li>
</ul>
</div>
</div>
<div class="quienes_pic"></div>
<div class="quienes_text">Main Text</div>
<div class="footer"></div>
</div>