skip to Main Content

I am building a website using the source files of a previous website I already built. My problem is that the tags that belong to the HEAD appear in the BODY in browsers inspectors (Firefox and Chrome). Here is my HEAD:

<!DOCTYPE HTML>
<html lang="<?php echo $lg; ?>">
 <head>
  <base href="<?php echo $cfg->getHostDirectory(); ?>assets/cpanel/">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!--<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico">-->
  <link rel="stylesheet" type="text/css" href="../css/playfair-display.css">
  <link rel="stylesheet" type="text/css" href="../css/font-awesome.min.css">
  <link rel="stylesheet" type="text/css" href="../css/glyphicons.css">
  <link rel="stylesheet" type="text/css" href="../css/ts-css.css">
  <link rel="stylesheet" type="text/css" href="../css/admin.css">
  <script src="../js/jquery.js"></script>
  <script src="../js/modernizr-custom.js"></script>
  <script src="../js/ts-jquery.js"></script>
  <script src="../js/js-admin-create.js"></script>
  <title><?php echo $cfg->getTitle($fileName, $lg); ?></title>
</head>

For some reason, I do not understand these tags goes in the BODY at runtime.
I searched on the StackOverflow for solutions but I cannot find anything helpful.

Update:

Chrome Browser inspector

Update:
Here I see a weird duplicate that does not actually exist in the real file!!!
enter image description here

2

Answers


  1. I had the same problem when adding a custom <jsdata>-tag to my head. So I think it is due to your <base>-tag. In don’t know why you need it but try deleting it or put it at the end of your head because only all the tags after your custom tag will be moved into the body.

    Login or Signup to reply.
  2. I had a similar issue with a registration form action to another page (which processed the registration and told the user an email had been sent for them to complete the process) but this latter page appeared to show all the html tags as text!

    I tracked it down to a set-up file I had required, which had set the header content-type to application/json, thereby causing the browser to try and treat the response as an AJAX type response rather than a page to be loaded.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search