在Django管理页面中向页脚添加文本

时间:2014-04-01 03:40:06

标签: html css django

我正在尝试将自动生成的django管理页面自定义为更个性化的内容。我想在页脚中添加文本,但到目前为止,我尝试过的所有内容都没有用。这是html。此处的尝试将在没有由css创建的页脚栏的内容之后显示页脚文本。这是html:

{% extends "admin/base.html" %}
{% load i18n %}

{% block title %}{{ title }} | {% trans 'Sunstreet Administration' %}{% endblock %}

{% block extrastyle %}

<!-- <head>
    <link rel="stylesheet" href="headerfooter.css" type="text/css"/>
</head> -->

<style>


#header{ width:100%;
background-color: 
#DF4F44;
border-bottom: solid 3px #999;
display: block;
background-image:url("/img/sunstreet.png") no-repeat right top; }



#branding h1{ color: #fff; }
.module h2, .module caption, .inline-group h2 { background:#ccc url(/img/admin/nav-bg.gif) bottom          left repeat-x; color: #333940; }
a.section:link, a.section:visited { color: #9CA974; }


#footer h5{ position:fixed; bottom:0;
width: 100%; height:5px; background-color: #DF4F44; 
border-bottom: solid 3px #999;
}


</style>

<!-- <footer class="footer">

    <div class="copyright">
        Copyright &copy; 2014 LOL. All rights reserved
    </div>
</footer> -->

{% endblock %}
{% block branding %}
<h1 id="site-name">{% trans 'Database' %}</h1>

{% endblock %}



{% block nav-global %}

{% endblock %}

{% block footer %}
<h5> 'Text in footer'  </h5>
{% endblock %}

1 个答案:

答案 0 :(得分:0)

你试试: 从

<!-- <head>
<link rel="stylesheet" href="headerfooter.css" type="text/css"/>
</head> -->

为:

{% load staticfiles %}
<!-- <head>
<link rel="stylesheet" type="text/css" href= " {% static "headerfooter.css" %}" />
</head> --> 

将headerfooter.css放在文件夹static / headerfooter.css