gpt4 book ai didi

html - 扩展 base.html 后,我的 child html 内容没有显示

转载 作者:行者123 更新时间:2023-12-02 03:24:03 25 4
gpt4 key购买 nike

在扩展之前,我已经检查了所有连接和文件路径,但在扩展我的子代码之后消失了

base.html

<!DOCTYPE html>
{% load staticfiles%}
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="icon" type="image/x-icon" href="{% static '/images/icon.png' %}" />
<title>allgood.com</title>
<link href="{% static "/css/base.css" %}" rel="stylesheet"
type="text/css"/>
</head>
<body>
<div class="header">
<span class="name">allgood</span>
<button class="btn1 ">Resume</button>
<button class="btn2 ">resume</button>
<span class="profileimage"><img src="{%static '/images/profile1.png'
%}" style="width:40px;height:40px"></span>

</div>
</body>
</html>

技能.html

{% extends 'app/base.html' %}

{% block content %}
<p>skills</p>
<p>skills</p>
<p>skills</p>
{% endblock %}

最佳答案

您的 base.html 文件仍应包含 block 部分

<!DOCTYPE html>
{% load staticfiles%}
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="icon" type="image/x-icon" href="{% static '/images/icon.png' %}" />
<title>allgood.com</title>
<link href="{% static "/css/base.css" %}" rel="stylesheet"
type="text/css"/>
</head>
<body>
<div class="header">
<span class="name">allgood</span>
<button class="btn1 ">Resume</button>
<button class="btn2 ">resume</button>
<span class="profileimage"><img src="{%static '/images/profile1.png'
%}" style="width:40px;height:40px"></span>
{% block content %}
{% endblock %}
</div>
</body>
</html>

关于html - 扩展 base.html 后,我的 child html 内容没有显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53925091/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com