Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Cargue páginas html con estilos css desde jquery

Tengo un problema de estilos al cargar encabezados, contenido y pies de página con jquery. Por algún problema desconocido, solo se carga el contenido, independientemente de los estilos.

El código actual:

índice.html

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> $(function () { $("#header").load("header/header.html"); $("#footer").load("footer/footer.html"); $("#content").load("content/content.html"); }); </script> <link rel="stylesheet" type="text/css" href="css.css"> </head> <body> <div id="header"></div> <div id="content"></div> <div id="footer"></div> </body> </html>

Header.html Recibo un error js: (Se negó a aplicar el estilo de 'http://127.0.0.1:XXXX/project/css.css' porque su tipo MIME ('text/html') no es un tipo MIME de hoja de estilo compatible , y la verificación estricta de MIME está habilitada). Aunque ni "src" ni "href" funcionan

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" type="text/css" href="../css.css"> </head> <body class="bodyHeader"> <hr> HEADER <hr> </body> </html>

css.css

 .bodyHeader { background-color: lightblue; } .bodyFooter { background-color: lightslategray; } .bodyContent { background-color: lightyellow; }

Actualmente muestro texto sin estilos.

ENCABEZAMIENTO

CONTENIDO

PIE DE PÁGINA

Quiero visualizar:

DIV [todo el contenido, medidas y estilos] ENCABEZADO

DIV [todo el contenido, medidas y estilos] CONTENT

DIV [todo el contenido, medidas y estilos] FOOTER

Sin que ninguno de ellos se superponga y respetando las distancias.

¿Es un problema de jquery?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!