如何将字符串添加到Django模板?

时间:2019-03-12 21:42:57

标签: css django templates inline

我要使用这段代码...

<section data-name="color1" data-type="color" data-order="2" style="color:{{ block.color1|default:"inherit" }}">

默认情况下,该标签在html中输出。

<section data-name="color1" data-type="color" data-order="2" style="color: rgb(0, 0, 0);">

由于我的一个子元素发生颜色冲突,因此未应用block.color1变量的颜色。我想在嵌入式CSS输出中添加“!important”以解决此问题。换句话说,我想要输出

<section data-name="color1" data-type="color" data-order="2" style="color: rgb(0, 0, 0) !important;">
HTML中的

。我可以在Django中添加些什么,以确保在CSS中收到带有!important的输出?

0 个答案:

没有答案
相关问题