Skip to content

Commit

Permalink
Fixed the footer
Browse files Browse the repository at this point in the history
  • Loading branch information
O662 committed Dec 27, 2024
1 parent 43e517f commit 8d5662c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
2 changes: 1 addition & 1 deletion footer.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<p>Copyright © 2024 Malcolm Ferguson</p>
<p>Copyright &copy; <span id="current-year"></span> Malcolm Ferguson!</p>
<p>Made with love and tears ❤️</p>
29 changes: 14 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,20 @@ <h2>Contact</h2>
<p>Pardon the dust, we're cooking rn!</p>
</section>

<footer>
<section id=indexFoot>
<div id="theFooter"></div>
<!--acts as a placeholder in the code where the navbar content will be inserted.-->
<script>
fetch('footer.html?cache-bust=' + new Date().getTime())
.then(response => response.text())
.then(data => {
document.getElementById('theFooter').innerHTML = data;
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
</script>
</section>
<footer id ="footerIndex" >
<div id="theFooter"></div>
<!--acts as a placeholder in the code where the navbar content will be inserted.-->
<script>
fetch('footer.html?cache-bust=' + new Date().getTime())
.then(response => response.text())
.then(data => {
document.getElementById('theFooter').innerHTML = data;
document.getElementById('current-year').textContent = new Date().getFullYear();
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
</script>
</footer>

</body>
Expand Down
22 changes: 22 additions & 0 deletions stylesFooter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
body {
font-family: Arial, sans-serif;
background-color: black;
color: white;
padding: 0;
margin: 0;
box-sizing: border-box;
}

footer {
background-color: #000; /* Match the background color of odd sections */
color: #fff;
padding: 60px;
box-sizing: border-box;
text-align: center; /* Center the text */
position: relative;
}

footer p {
margin: 0;
padding: 10px 0;
}

0 comments on commit 8d5662c

Please sign in to comment.