我试图将脚放在页面底部。为此,我阅读了很多网站,所有这些网站都告诉我同样的情况。
完成上述操作后,我的页脚真的卡在了底部......但是......页面的内容被这个覆盖了!
我的 CSS 具有以下属性:
html, body {
height: 100%;
}
body {
margin: 0px;
font-family: Arial;
background-image: url("../img/bg2.jpg");
}
.geral {
min-height:100%;
position: relative;
}
.container {
width: 900px;
}
.container img {
width: 250px;
float: left;
}
.container .btn_criar_conta {
width: 100px;
float: right;
}
.container .user_detail {
width: 300px;
float: right;
}
#topo_pagina {
height: 110px;
}
.box_login_conteiner {
width: 410px;
text-align: left;
}
.box_login {
width: 350px;
min-height: 200px;
background-color: white;
font-family: Arial;
font-size: 13px;
text-align: right;
padding: 10px;
border: 1px white solid;
border-radius: 0.5em;
color: grey;
box-shadow: lightgrey 0.0em 0.5em 0.9em;
padding-right: 50px;
}
.box_login li {
list-style: none;
}
.box_login a {
color: blue;
text-decoration: none;
}
.box_login a:hover {
color: blue;
text-decoration: underline;
}
.box_login input {
border: 1px whitesmoke solid;
border-radius: 0.5em;
box-shadow: lightgrey 0.0em 0.1em 0.1em;
height: 30px;
width: 250px;
padding: 5px;
color: grey;
}
.box_login .img {
border: none;
width: 100px;
}
.box_login .btn_submit {
border: 1px seagreen solid;
border-radius: 2em;
box-shadow: grey 0.0em 0.1em 0.1em;
height: 30px;
width: 100px;
padding: 5px;
color: white;
background-color: seagreen;
}
.index_login {
text-align: justify;
float: right;
width: 400px;
color: #2b3856;
font-family: Geneva;
}
.index_login img{
text-align: right;
width: 400px;
}
.index_login hr {
background-color: lightblue;
border: 0px;
}
.info_login {
font-size: 11px;
padding: 5px;
background-color: lightgrey;
border-radius: 0.5em;
color: grey;
}
.info_login a {
color: blue;
text-decoration: none;
}
.info_login a:hover {
color: blue;
text-decoration: underline;
}
.box_registrar_conteiner {
width: 430px;
text-align: left;
}
.box_registrar {
width: 430px;
min-height: 200px;
background-color: white;
font-family: Arial;
font-size: 13px;
text-align: right;
padding: 10px;
border: 1px white solid;
border-radius: 0.5em;
color: grey;
box-shadow: lightgrey 0.0em 0.5em 0.9em;
padding-right: 50px;
}
.box_registrar li {
list-style: none;
}
.box_registrar a {
color: blue;
text-decoration: none;
}
.box_registrar a:hover {
color: blue;
text-decoration: underline;
}
.box_registrar input {
border: 1px whitesmoke solid;
border-radius: 0.5em;
box-shadow: lightgrey 0.0em 0.1em 0.1em;
height: 30px;
width: 250px;
padding: 5px;
color: grey;
}
.box_registrar .img {
border: none;
width: 100px;
}
.rodape {
position: absolute;
bottom: 0;
width: 100%;
height: 150px;
background-color: grey;
color: white;
font-family: Geneva;
font-size: 11px;
}
.rodape a {
color: white;
text-decoration: none;
}
.rodape a:hover {
color: white;
text-decoration: underline;
}
.rodape #menu {
float: left;
margin-right: 50px;
}
.container_footer {
width: 900px;
text-align: left;
}
我的 HTML 是这样的:
<html>
<head>
<title>Site</title>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/style1.css">
</head>
<body>
<div class="geral">
<div id="topo_pagina">
<div align="center">
<div class="container">
<br/>
<br/>
<a href="/"><img src="{{ STATIC_URL }}img/logo1.png"></a>
{% if user.is_authenticated %}
<div class="user_detail">
<br/>
Olá {{ user.first_name|capfirst }}! - <a href="/logout/">Logout</a>
</div>
{% else %}
<a href="/login/"><input type="image" src="{{ STATIC_URL }}img/btn_logar_conta.png" class="btn_criar_conta"></a>
<a href="/registrar/"><input type="image" src="{{ STATIC_URL }}img/btn_criar_conta.png" class="btn_criar_conta"></a>
{% endif %}
</div>
</div>
</div>
<div id="conteudo_pagina">
<div align="center">
<div class="container">
{% block conteudo_pagina %}
{% endblock %}
</div>
</div>
</div>
<br clear="all">
<div class="rodape">
<div align="center">
<div class="container_footer">
<div id="menu">
<h4>Multiplikação</h4>
<a href="/login/">Acessar</a><br/>
<a href="/registrar/">Criar conta</a><br/>
</div>
<div id="menu">
<h4>Sobre a empresa</h4>
Quem somos<br/>
Nosso time<br/>
Trabalhe com a gente<br/>
</div>
<div id="menu">
<h4>Conectividade</h4>
Facebook<br/>
Twitter<br/>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
有人可以帮助我吗?我真的不知道该尝试什么。=(
提前感谢大家!