1

I have tried:

<html src="navbar.html"></html>

I have a file called navbar.html

Is there any way I could make it appear on every page I have?

I will be changing the navbar a lot throughout my website and I don't want to change it in all my 20+ pages. How can I make this one file appear in every page?

Would it be possible to make it in html rather than jquery and append it to every page?

something similar to

<script src="file.js"></script>

But html src

James K
  • 3,302
  • 1
  • 24
  • 35
killereks
  • 179
  • 1
  • 9

2 Answers2

1

Why not just use PHP? As long as you're developing on a server (as PHP is server side) you can essentially change .html files to .php and include a file for the navbar. For example:

<?php include 'navbar.php'; ?>

Look up PHP include at http://php.net/manual/en/function.include.php. It will do exactly what you want. All you do is include the file on every page and it will be reflected in every page .

James Jones
  • 3,632
  • 5
  • 21
  • 41
dee
  • 13
  • 5
0
<a href="http://www.w3schools.com/html/">Visit our HTML tutorial</a>

The href attribute specifies the destination address (http://www.w3schools.com/html/) of the link.

The link text is the visible part (Visit our HTML tutorial).

Clicking on the link text will send you to the specified address. http://www.w3schools.com/html/html_links.asp

Razia sultana
  • 1,963
  • 1
  • 12
  • 20