我正在尝试自定义我的tumblr视频缩略图,以便我可以针对每个视频帖子的特定图像。
HTML代码是:
{block:Video}
<div class="media-embed">
{block:IndexPage}
<script class="template-replace" type="text/template">
{VideoEmbed-700}
</script>
<div class="video-thumbnail template-remove"{block:VideoThumbnail} style="background-image:url({VideoThumbnailURL});"{/block:VideoThumbnail}></div>
{/block:IndexPage}
{block:PermalinkPage}
{VideoEmbed-700}
{/block:PermalinkPage}
{block:IndexPage}
<div class="video button-overlay {select:Button colors} template-remove"></div>
{/block:IndexPage}
</div>
{block:Caption}
<div class="caption">
{Caption}
{block:More}{block:IfReadMoreText}<p class="read-more-text"><a href="{Permalink}">{text:Read More Text}</a></p>{/block:IfReadMoreText}{/block:More}
</div>
{/block:Caption}
{/block:Video}
我想我应该替换style="background-image:url({VideoThumbnailURL})
,但我不知道我应该用什么代码来替换它。任何想法吗?谢谢!B
试试这个:
{block:VideoThumbnail}
{VideoThumbnailURL}
{/block:VideoThumbnail}
我建议您查看{TagsAsClasses}变量。
<div class="video-thumbnail template-remove {TagsAsClasses}"{block:VideoThumbnail} style="background-image:url({VideoThumbnailURL});"{/block:VideoThumbnail}></div>
你可以用一个独特的标签标记每个视频帖子,然后简单地用css样式。
.thumbnailtest {
/* add your styles here */
}