I'm currently in the process of developing a new website and I'd like to add a footer within a container div situated at the bottom.
After some research, I came across a JavaScript library known as Tether (), but I've run into issues with its implementation.
Here is the HTML code I've been working with:
<html>
<head>
<title>Bug Reporting</title>
<link href="StyleSheet.css" type="text/css" rel="stylesheet" />
<script src="includes/jquery.js"></script>
<script src="includes/tether/tether.js"></script>
<script>
$(document).ready(function()
{
new Tether({
element: '.footer',
target: '.container',
attachment: 'top left',
targetAttachment: 'bottom left'
});
});
</script>
</head>
<body>
<div class="container">
<header>
This is the body
</header>
<div id="content">
This is the content<br />
</div>
<div class="footer1">
This is the footer
</div>
</div>
</body>
</html>
Below you'll find my StyleSheet code:
html, body
{
font-family: arial;
margin: 0;
padding: 0;
}
header
{
background-color: red;
width: 100%;
height: 80px;
}
.container
{
background-color: yellow;
height: calc(100% - 80px);
width: 100%;
}
#content
{
background-color: blue;
width: 1024px;
margin-left: auto;
margin-right: auto;
height: auto;
}
.footer1
{
position: absolute;
background-color: green;
width: 100%;
height: 80px;
}
The issue I'm facing is that upon loading the page, an exception occurs within the tether library:
Uncaught TypeError: Cannot read property 'classList' of null
I would greatly appreciate any assistance or guidance you can offer on this matter.