cozyamanda
45 minutes ago
i'm not 100% sure if it's applicable but i think you can achieve this with javascript. i believe i'm doing this on my site by flipping through the 'tabs' or different sections of my site. you can check the bottom of my index code if it's helpful. i hope someone else is able to chime in with more useful info!
toffii
40 minutes ago
@cozyamanda Thank you, Amanda, for letting me looksie! 🥹 I'm going to do a lot of trial and error and see what I can come up with LOL!!
chiisana-wasurenagusa
34 minutes ago
easiest beginner-friendly fix is to put your shared layout (header, nav, footer, etc.) in one JavaScript file so you only have to edit it once. Create a file called layout.js in your root folder and put something like this inside it:document.addEventListener("DOMContentLoaded", function () { if (!document.body.classList.contains("no-layout")) {
chiisana-wasurenagusa
33 minutes ago
document.body.insertAdjacentHTML("afterbegin", headerEl); document.body.insertAdjacentHTML("beforeend", footerEl); } });
chiisana-wasurenagusa
32 minutes ago
const headerEl = ` <header> <!-- your header / nav HTML goes here --> <nav> <a href="/">Home</a> <a href="/about.html">About</a> <!-- etc --> </nav> </header> `;
chiisana-wasurenagusa
32 minutes ago
const footerEl = ` <footer> <!-- your footer HTML goes here --> </footer> `;
chiisana-wasurenagusa
31 minutes ago
Put all these lines in one .js. on every page, put this in the <head> (or just before the closing </body>): <script src="layout.js"></script>
chiisana-wasurenagusa
30 minutes ago
Just don't forget to put relative paths if you have any subfolders like I do.
toffii
1 week ago
Updated my credits page! As always, if anybody sees anything that needs to be credited, /please/ let me know! I don't mean to use anything improperly. <3
ooooooh i'm obsessed with your media page! :) <3