Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Django颜色在trans标记中不被覆盖_Html_Django_Django Admin - Fatal编程技术网

Html Django颜色在trans标记中不被覆盖

Html Django颜色在trans标记中不被覆盖,html,django,django-admin,Html,Django,Django Admin,我想定制我的Django admin base.html 我想更改名为“div用户工具”的div标记的颜色 因此,我在admin/base.html中进行了更改 <div id="user-tools" style="color:red;"> {% trans 'Welcome,' %} <strong>{% filter force_escape %}{% firstof user.first_name user.usern

我想定制我的Django admin base.html

我想更改名为“div用户工具”的div标记的颜色

因此,我在admin/base.html中进行了更改

       <div id="user-tools" style="color:red;">
        {% trans 'Welcome,' %}
        <strong>{% filter force_escape %}{% firstof user.first_name user.username %}{% endfilter %}</strong>.
        {% block userlinks %}
            {% url 'django-admindocs-docroot' as docsroot %}
            {% if docsroot %}
                <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
            {% endif %}
            {% url 'admin:password_change' as password_change_url %}
            {% if password_change_url %}
                <a href="{{ password_change_url }}">
            {% else %}
                <a href="{{ root_path }}password_change/">
            {% endif %}
            {% trans 'Change password' %}</a> /
            {% url 'admin:logout' as logout_url %}
            {% if logout_url %}
                <a href="{{ logout_url }}">
            {% else %}
                <a href="{{ root_path }}logout/">
            {% endif %}
            {% trans 'Log out' %}</a>
        {% endblock %}
    </div>

{%trans'欢迎,'%}
{%filter-force\u-escape%}{%firstof-user.first\u-name-user.username%}{%endfilter%}。
{%block userlinks%}
{%url'django admindocs docroot'作为docsroot%}
{%if docsroot%}
/
{%endif%}
{%url'管理员:密码\u更改'作为密码\u更改\u url%}
{%如果密码\u更改\u url%}
/
{%url'管理员:注销'作为注销\u url%}
{%if注销_url%}
{%endblock%}
但它不会影响管理页面中的内容

特别是内部的“trans”变量不影响

我附加的输出截图

你能在图片的拐角处提出这个问题吗?

您可以这样覆盖颜色

{% block extrastyle %}
#user-tools {color:blue;}
#user-tools a:link,#user-tools a:visited {color:blue;}
...
{% endblock %}

刚刚尝试过

这是因为它有自己的风格,您需要扩展管理css文件,然后您可以执行类似#user tools a{color:red}的操作,即使它不影响。。{%block extrastyle%}标题{背景色:{e5e5;边框底部:实心3px{999;}用户工具{color:green;}用户工具a{color:green;}{%endblock%}同一问题再次出现。关闭?我会链接到css文件,而不是像那样内联使用它,它可能会变得混乱。