Skip to content Skip to sidebar Skip to footer

Universal Header In HTML

I want to create a universal header (and footer) using HTML/CSS/Javascript so that if I update it to one page, it automatically updates on the rest. I also want to be able to choos

Solution 1:

You can use jQuery to .load a HTML file:

HTML

<div id="header"></div>

jQuery

$('#header').load('static.html');

Alternatively, you could use iframe to load your static header. See this answer for more information regarding the available techniques.


Solution 2:

Maybe try Jekyll, this is a tool to generate static pages, also this is how the githup page handles your own personal page. You just follow the file structure and set the layout properties in your files, then you can use the universal layout (including header, footer etc.) in your page.

Here is a link to Jekyll.Jekyll


Post a Comment for "Universal Header In HTML"