wordpress中嵌入B站视频自适应显示

发布于:2021-10-17 16:33:38

只记录了代码,
参考自网络,也不知道是哪一篇了


放在css中的:


.smartideo { z-index: 0; text-align: center; background: #CCC; line-height: 0; text-indent: 0; }
.smartideo embed, .smartideo iframe { padding: 0; margin: 0; }
.smartideo .player { width: 100%; height: 500px; overflow: hidden; position: relative; }
.smartideo .player a.smartideo-play-link { display: block; width: 50px; height: 50px; text-decoration: none; border: 0; position: absolute; left: 50%; top: 50%; margin: -25px; }
.smartideo .player a.smartideo-play-link p { display: none; }
.smartideo .player .smartideo-play-button { width: 0; height: 0; border-top: 25px solid transparent; border-left: 50px solid #FFF; border-bottom: 25px solid transparent; }
.smartideo .tips { background: #f2f2f2; text-align: center; max-height: 32px; line-height: 32px; font-size: 12px; }
.smartideo .tips a { text-decoration: none; }

@media screen and (max-width:959px){
.smartideo .player { height: 450px; }
}
@media screen and (max-width:767px){
.smartideo .player { height: 400px; }
}
@media screen and (max-width:639px){
.smartideo .player { height: 350px; }
}
@media screen and (max-width:479px){
.smartideo .player { height: 250px; }
}

嵌入到wordpress文章中的html代码:


最新更新

猜你喜欢