将django添加到项目后,HTML head标签出现在body标签内

时间:2019-06-27 06:50:19

标签: python html css django web

在添加Django之前,以下HTML代码可根据需要进行工作。我没有做任何更改,但是现在执行它时,它在页面顶部有一个缩进,并且head标签出现在chrome的body标签内。我试图更改某些Django语法的位置,但没有任何改变。

Here is the output of the code + code inside block

 {% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name = "viewport" content="width=device-width">
    <meta name="description" content="Help Pets. We care about animals.">
    <meta name="keywords" content="charity, foundation, help pets, adoption">
    <meta name="author" content="Irina Gorbacheva">
    <title>Help Pets | Home page</title>
    <link rel="stylesheet" href="{% static 'style.css' %}">
</head>

<body>
    <header class="header">
        <div class="container">
            <img src="{% static 'imgs/footprint.png' %}">
            <div id="logo">
                <h1><span>Help</span> Pets</h1>
            </div>

            <div>
                <button id ="popupclick">Donate</button>
            </div>

            <nav id="navbar" class="topnav">
                <a href="{% url 'home' %}" id="cur">Home</a>
                <a href="{% url 'help' %}">Help</a>
                <a href="{% url 'adoption' %}">Rehoming</a>
                <a href="{% url 'reports' %}">Reports</a>
                <a href="{% url 'about' %}">About us</a>
                <a href="javascript:void(0);" class="icon" onclick="responsive()">
                    <svg width="30" height="30">
                        <path d="M0,5 30,5" stroke="#fff" stroke-width="5"/>
                        <path d="M0,14 30,14" stroke="#fff" stroke-width="5"/>
                        <path d="M0,23 30,23" stroke="#fff" stroke-width="5"/>
                    </svg>
                </a>
            </nav>

        </div>

    </header>

{% block content %}
{% endblock content %}

</body>
</html>

0 个答案:

没有答案