Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.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 在Tumblr中基于每个帖子定义样式_Html_Css_Colors_Styling_Tumblr - Fatal编程技术网

Html 在Tumblr中基于每个帖子定义样式

Html 在Tumblr中基于每个帖子定义样式,html,css,colors,styling,tumblr,Html,Css,Colors,Styling,Tumblr,我创建了以下样式作为博客文章的标题 h4 {font-family: "futura", "helvetica", sans-serif; position:center; line-height:56px; font-size:38px; letter-spacing:1px; font-weight:bold; text-align:center; padding- right:20px; padding-left:20px; color:white;border-style:s

我创建了以下样式作为博客文章的标题

h4 {font-family: "futura", "helvetica", sans-serif; position:center; line-height:56px;      
font-size:38px; letter-spacing:1px; font-weight:bold; text-align:center; padding-
right:20px; padding-left:20px; color:white;border-style:solid;
border-top-width: 22px; border-bottom-width: 0px; border-left-width:0px; border-right- 
width:0px; border-top-color:#F15B4C; border-bottom-color:#F15B4C; background-
color:#F15B4C;}
我正在工作的网站将以几个艺术品“链”为特色。随着时间的推移,艺术家们对同一件艺术品进行返工,从而将每一条链连接在一起。我想用头的唯一背景色来区分每个链


我希望能够以某种方式更改行中每个帖子的颜色,但由于这是一个被黑客攻击的Tumblr主题,我只能做有限的事情。有没有关于如何在Tumblr的混合HTML/CSS样式中创建其他样式的建议

您可以通过标签来完成

这应该将类“chain3”应用于该标题的类

然后在你的CSS中

.caption.chain3{背景色:#0000ff;}


这一切都取决于标记是字符串,CSS当然可以将其解释为类声明。像“友谊是魔法”这样的标签不能是CSS类。

作为参考,我正在使用的网站是。我是HTML/CSS新手,非常感谢您的帮助!我已经尝试了很多可能的解决方案,但到目前为止运气不佳。您将如何识别每个链(在HTML中)?这是关键问题。@Marcin现在我只是在每篇文章的HTML编辑器中定义标题样式,但我希望能够在每篇文章中使用标记,并定义它继承的CSS样式。唯一的问题是,每篇文章实际上使用了两种不同的标题样式:一种用于较大的文本,另一种用于下方的小文本。不知道在发布答案时这是否可用,但Tumblr模板API现在有
{tagsasclass}
,它将以HTML类友好格式打印所有标记。