Ich möchte eine Fußzeile, die am unteren Rand der Seite ist, sowohl im Falle von wenig Inhalt und für den Fall, dass es sehr wenig ist.Fußzeile zum Ende der Seite
Ich habe bereits mehrere Tutorials verfolgt, aber entweder nicht funktioniert oder nicht das gewünschte Ergebnis, vielleicht habe ich etwas falsch versucht.
Jeder kann mir helfen? Danke
EDIT: hier ist es mein Code
HTML Seite
<html>
<head>
<title>
Test Pagina Vuota Footer
</title>
<style type="text/css">
html, body, .container {
margin: 0;
padding: 0;
}
body {
background-color: green;
color: white;
}
.container {
padding-top: 97px;
}
</style>
<script src="/inc/jquery.js"></script>
<script src="/inc/sticky-footer.js"></script>
</head>
<body>
<div class="container">
<? include("./inc/navbar"); ?>
<div class="content">
content of page
</div>
<?php include("./inc/footer"); ?>
</div>
</body>
</html>
HTML der Fußzeile
<html>
<head>
<title>
/inc/footer
</title>
<meta name="description" content="Footer del sito">
<style type="text/css">
.footer {
width: 100%;
background-color: orange;
color: white;
}
</style>
<script src="/inc/jquery.js"></script>
<script src="/inc/footer.js"></script>
</head>
<body>
<div class="footer">
© ************.altervista.org 2017
</div>
</body>
</html>
JS-Datei
// Window load event used just in case window height is dependant upon images
$(window).bind("load", function() {
var footerHeight = 0,
footerTop = 0,
$footer = $("#footer");
positionFooter();
function positionFooter() {
footerHeight = $footer.height();
footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
if (($(document.body).height()+footerHeight) < $(window).height()) {
$footer.css({
position: "absolute"
}).animate({
top: footerTop
})
} else {
$footer.css({
position: "static"
})
}
}
$(window)
.scroll(positionFooter)
.resize(positionFooter)
});
Können Sie bitte Ihren Code teilen? – Mika
Sie müssen uns Code zeigen. Und meinst du, du willst, dass es am unteren Rand der Seite (sticky) oder immer am unteren Rand des Ansichtsfensters angezeigt wird, egal wie weit du gescrollt (fixiert) bist? –
Bitte senden Sie den Code, wo Sie Probleme haben –