Include in <head> Djanto Templates

Asked

Viewed 57 times

2

I have the following files:

base.html:

<!-- base.html -- -->
<html>
    <head>
        <title>Title</title> 
        {% include "head.html" %} 
    </head>
    <body>
        Body
    </body>
</html>

head.html:

<!-- head.html -- -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="pt-br" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

My problem is when the browser interprets the pages, the code of the head.html are placed in the <body> page. I’ve tried using a block on head but the same problem happened, how I could solve this problem?

The browser interprets this way:

<html>
    <head>
        <title>Title</title> 
    </head>
    <body>
        "&#65279;"
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Language" content="pt-br" />
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        Body
    </body>
</html>

1 answer

2


So the problem was in the file encoding .HTML, I opened the file in a text editor, and saved it as UTF-8, and corrected the bug.

The browser was generating a special character that was considered text, so it played the code of head within the <body>page;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.