Wordpress文章页图片悬浮效果

本文转自 阿蛮君博客  WordPress 主题美化 - 文章页图片悬浮效果 - 阿蛮君博客 (amjun.com)

要让图片悬浮,添加如下 css 即可。因为阿蛮君觉得图片具体文字太近,加了一个 margin 属性,不需要的可以去掉。

/*文章图片悬浮效果*/
/*注意.post-content-content类的名称,不同的主题有可能是不同的类名*/

.post-content-content img {
    transition: All 0.4s ease-in-out;
    -webkit-transition: All 0.4s ease-in-out;
    -moz-transition: All 0.4s ease-in-out;
    -o-transition: All 0.4s ease-in-out;
    margin: 10px 0;
}
.post-content-content img:hover {
    transform: translate(0, -10px);
    -webkit-transform: translate(0, -10px);
    -moz-transform: translate(0, -10px);
    -o-transform: translate(0, -10px);
    -ms-transform: translate(0, -10px);
    box-shadow:5px 5px 10px gray;   
}
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享