php - 使用 CSS 在缩略图上播放按钮

标签 php html css wordpress

我正在尝试在我的 WordPress 中使用 CSS 在缩略图上显示播放按钮。我尝试了很多方法,但总是不好。你能帮帮我吗,我哪里错了?

.post-thumbnail-sidebar {
  display: block;
  text-align: center;
}
.post-thumbnail-sidebar embed,
.post-thumbnail-sidebar iframe,
.post-thumbnail-sidebar object {
  margin-bottom: 30px;
}

.post-thumbnail-sidebar a {
   position: absolute;
   display: block;
   background: url("https://i.imgur.com/FPwyRnP.png") no-repeat;
   height: 85px;
   width: 136px;
   top: 100%;
   left: 100%;
   margin: -64px 0 0 -88px;
}
<a class="post-thumbnail-sidebar" href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( $r_post_thumb_size, array( 'itemprop' => 'image' ) ); ?>
</a>

最佳答案

还不够,但我认为您可以从这里开始。 here's a fiddle

.second-img {
  position: absolute;
  top: 0px;
  margin-left: 20px 
}
<div>
<img class="background-img" width="100%" height="100%" style="position:absolute; top:0; left:0;" src=  "https://vincentloy.files.wordpress.com/2012/01/in-time-2011-r5-line-xvid-fusion_screenshot_4.jpg">
<a href = "https://vincentloy.files.wordpress.com/2012/01/in-time-2011-r5-line-xvid-fusion_screenshot_4.jpg"><img class="second-img" width="100%" height="100%" src = "http://sanyangfrp.com/data/out/805/511806414-play-button-png.png" /> </a>
</div>

关于php - 使用 CSS 在缩略图上播放按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48944287/

相关文章:

php - 如何在 WordPress 网站中找到损坏的 php 或 WP 文件

javascript - 如何在javascript中使用cheerio获取子属性值

c# - 在所有网页上使用相同的页眉和页脚

jquery - 如何使视差响应?

javascript - CSS/SVG 描边动画

html - Outlook 2007 将 HTML 电子邮件中的链接样式更改为在发送到 Hotmail、Gmail 等时带有蓝色下划线。有任何修复吗?

php - 带数组参数的 Symfony2 Doctrine2 查询

php - 脚本关闭后 MySQL 插入继续

php - LARAVEL 如何连接2个不同的数据库并连接位于不同服务器上的2个表?

javascript - 如何设置整体Grid缩略图高度相等?