Example with PHP
This example is great, as well as being very easy to implement on your site, it's easy to maintain. iframes force the server a lot.
You will have to create your page in PHP as it will use the require_once command.
First , create your page in PHP. Ex: index.php
Within the index.php , you can place require_once anywhere on the page, even in meta-tags p>
Ex:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pt-BR" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Aqui irá ficar o título da página</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<p>
HTML normal pode ser usado na pagina.
</p>
<!-- puxa o código do arquivo conteudo.php como se fosse um frame/iframe, só que ele renderiza a página como se o código dentro de conteudo.php fosse da própria página -->
<?php
require_once "conteudo.php"
?>
<!-- Você pode adicionar quantos, e onde quizer -->
</body>
</html>
Now let's create the conteudo.php
In it we'll put what will appear on the previous page we created. ( the index.php )
<p>
Isso é um texto, esse mesmo texto irá aparecer na página index.php como se esse texto fosse da própria página.
</p>
<a href="https://google.com"> Isso é um link que vai para o Google </a>
Now when you access the index.php page, it will display the content inside conteudo.php .
This is undoubtedly the best alternative, I just use it on my websites.
Note: The browser does not read PHP files locally (ie on your computer). If you open in the browser do not think that the code did not work because it is broken, because the code is right . The problem is that the browser does not run PHP locally . See below:
In order for you to see your normal page, it will either need to be hosted on a server, or you can install a WAMP so you can run PHP on computer. I recommend XAMPP , without question is the best. You can even install some CMS's on your computer such as: wordpress, joomla, drupal, etc.