1

Is there a way to import a block of HTML into a file without the use of something like PHP or Javascript? For my personal website, any time I make a small change to the content of my navbar, I have to go to all of my other pages and make that same change.

1
  • You could probably use an iFrame. Commented Jul 27, 2012 at 3:54

2 Answers 2

3

Do an internet search for "Server Side Includes for HTML"

Here's a good start: http://en.wikipedia.org/wiki/Server_Side_Includes

Example:

<!--#include virtual="header.html" -->
Sign up to request clarification or add additional context in comments.

3 Comments

Not sure why this just got a down vote. SSI is exactly what the OP was asking for.
@Charlie - SSI works just fine on any HTML page. And most all web servers that I know of support it. It does not require PHP.
My mistake :) I always thought this was PHP specific, but I'm wrong. Good to know.
0

No feature like the one you described is in the HTML spec, but if you don't have access to server configurations and the like, you can write your code in a language like HAML and compile it, which would accomplish what you described without any server-side work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.