Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.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
Css Tumblr:显示邮政编码_Css_Tumblr - Fatal编程技术网

Css Tumblr:显示邮政编码

Css Tumblr:显示邮政编码,css,tumblr,Css,Tumblr,我第一次修改了Tumblr主题,我想知道是否有办法显示帖子的编号。第一个帖子是#1,第二个帖子是#2,依此类推 这可能吗?遗憾的是,由于Tumblr不支持这种逻辑/功能,因此没有一个主题操作符可以打印出当前的帖子编号 但是,您可以伪造它: CSS .post:nth-child( 1 ) .number:after { content: ' 1'; } .post:nth-child( 2 ) .number:after { content: ' 2'; } .post:nth-chil

我第一次修改了Tumblr主题,我想知道是否有办法显示帖子的编号。第一个帖子是#1,第二个帖子是#2,依此类推


这可能吗?

遗憾的是,由于Tumblr不支持这种逻辑/功能,因此没有一个主题操作符可以打印出当前的帖子编号

但是,您可以伪造它:

CSS

.post:nth-child( 1 ) .number:after {
  content: ' 1';
}
.post:nth-child( 2 ) .number:after {
  content: ' 2';
}
.post:nth-child( 3 ) .number:after {
  content: ' 3';
}
.post:nth-child( 4 ) .number:after {
  content: ' 4';
}
.post:nth-child( 5 ) .number:after {
  content: ' 5';
}
HTML

  <div class="post">
    <p class="number">Post</p>
  </div>
  <div class="post">
    <p class="number">Post</p>
  </div>
  <div class="post">
    <p class="number">Post</p>
  </div>
  <div class="post">
    <p class="number">Post</p>
  </div>
  <div class="post">
    <p class="number">Post</p>
  </div>

职位

职位

职位

职位

职位

结果