Defining style per tags in Tumblr(在 Tumblr 中定义每个标签的样式)
问题描述
我想知道如何为特定标签定义特定样式.例如,如果我的帖子带有羊角面包或巧克力标签,我想让它们呈现某种风格.
I would like to know how to define the specific style for specific tags. For instance, I would like to have my posts render a certain style if they're tagged with Croissant or Chocolate.
我想知道我必须创建一个新类,并且我知道我必须为这个新类设置样式,但我不知道该怎么做.
I think know I have to create a new class and I know I have to style this new class but I don't know how to do it.
感谢您的帮助!
推荐答案
您需要在主题中使用 {TagsAsClasses}
.
You'll need to use {TagsAsClasses}
in your theme.
例如,您需要为您的主题编写类似的内容:
For example, you'll need to write something like for your theme:
<div id="{PostID}" class="post {PostType} {TagsAsClasses}">
<!-- ... -->
</div>
如果您的帖子是照片帖子并且带有Croissant 和Chocolate 标签,那么您的HTML 将变为:
If your post is a photo post and has the tags Croissant and Chocolate, then your HTML becomes:
<div id="post-26107509778" class="post photo Croissant Chocolate">
<!-- ... -->
</div>
然后您可以设置 .Croissant 或 .Chocolate 类的样式:
and then you can set the styles for the .Croissant or .Chocolate classes:
.Croissant {
/* add your styles here */
}
.Chocolate {
/* add your styles here */
}
更多信息请点击此处http://www.tumblr.com/docs/en/custom_themes
这篇关于在 Tumblr 中定义每个标签的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Tumblr 中定义每个标签的样式


基础教程推荐
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01