Using different styles for categories in tumblr?

后端 未结 1 905
长情又很酷
长情又很酷 2021-01-07 11:58

I want to be able to post photos to tumblr with different tags (e.g. cars, motorcycles, ships). Then, in the post each tag should display a different colored horizontal line

相关标签:
1条回答
  • 2021-01-07 12:29

    If you change your theme's markup to add the post tags as HTML classes, then you can setup CSS properties based on tags. For example, you set your theme like that:

    {block:Posts}
        <div class="post {TagsAsClasses}">
             ....
    

    And set up your CSS like that:

    div.cars hr {
       color: blue;
    }
    
    div.motorcycles hr {
       color: red;
    }
    

    This will add HTML classes to every post's container element, which are based on the tags you define, and allows you to create different styling based on those tags.

    You can see this for more information: http://www.tumblr.com/docs/en/custom_themes#posts

    0 讨论(0)
提交回复
热议问题