Developing an app that has menus in menu files separate from the contents, Oce solves the maintenance problem, but creates another problem, rendering.
Since Voce did not give details of your project, I will assume that using a css and php framework, basically Voce can split your pages into three parts
- Menus (header)
- Conteudo ()
- footer ()
Menu file.html
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
</head>
<body>
content.html file
<h1>Seu conteudo Aqui!</h1>
footer.html file
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
</body>
</html>
In your index.php file
<?php
require "menu.html";
$url = explode('/', $_SERVER['REQUEST_URI']); // Obtem a url e passa em forma de array
switch($url[1]) { // compara o url para saber qual pagina carregar
case "home":
require "content.html";
case "sobre":
require "sobre.html";
default:
require "content.html";
}
require "footer.html";
?>
In this case, in other words, you will create your route system.
I have an example that I am still studying, but take a look there that Voce will better understand what I tried to explain.
https://github.com/henriquek3/economize
Are you using any language server-side?
– Woss
No. HTML and CSS only.
– Flávio Menezes
You can do something with Javascript, at most. Has the subject discussed on Soen.
– Woss
In the project was vetoed the use of Javascript. I also can not use PHP.
– Flávio Menezes
So you have no options. At most use an HTML pre-processor, such as Pug, which allows you to import.
– Woss
With pure HTML, use an iframe.
– Antonio Alexandre
It would be good if you edit your question and put that you are not using any language server-side and also cannot be a solution with Javascript. This can improve the quality of your answers.
– Raizant