Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

131
Visualizações
How to dynamic insert the header and footer of mainpage.html on other pages?

I looked for many examples of how to display the same header and footer from one page to others dynamically without having to repeat the same html code and style.

And unfortunately I couldn't find a clear example of doing this, I've seen that it's possible using PHP, but I haven't found any practical examples.

I will be very grateful if anyone can give me an example or an article about.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

you could use include() for php, you have the header in one page and your footer in other. header.php somthing like

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
</head>
<body>

footer.php

<footer>
  <p>Author: Hege Refsnes</p>
  <p><a href="mailto:hege@example.com">hege@example.com</a></p>
</footer>
</body>
</html>

every other page

<?php include 'header.php';?>
<div>
your content...

</div>
<?php include 'footer.php';?>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda