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

154
Visualizações
How to include the CSS for a div you are loading from another page

I am attempting to load content from a div on one page of my site to another page on my site on page-load.

The following (example) code seems to achieve that effectively.

However... how would I also include all of the CSS associated with the content?

Any help would be greatly appreciated.

SOURCE PAGE

<!DOCTYPE html>

<html>

<head lang="en">

<link rel="stylesheet" href="exampleStylesheet.css">

</head>

<body>

<div>SOURCE CONTENT HERE</div>  

</body>

</html>

LANDING PAGE

<!DOCTYPE html>

<html>

<head lang="en">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

</head>

<body>

<div id="loadedContent"></div>

<script>

$('#loadedContent').load("contentToLoad.html"); <!-- loads other page's content -->

</script>

</body>

</html>

EXAMPLE CSS

body {

margin: 0;
background-color: blue;

}
about 4 years ago · Juan Pablo Isaza
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