使用php文件在wordpress中以移动模式调整视频大小

使用php文件在wordpress中以移动模式调整视频大小,php,html,wordpress,video,mobile,Php,Html,Wordpress,Video,Mobile,在responsive.css中,iframe是一个html元素,而不是一个类。所以像这样瞄准它 @media screen and (max-width: 799px) { .container .iframe{height:250px !important;}} 不行。试试这个: .iframe WordPress可以检索视频的宽度/高度并生成iframe代码 .container iframe {height: 250px;} 如果您想要响应视频,请尝试jQuery插件。ifr

在responsive.css中,iframe是一个html元素,而不是一个类。所以像这样瞄准它

@media screen and (max-width: 799px) {
 .container .iframe{height:250px !important;}}
不行。试试这个:

.iframe

WordPress可以检索视频的宽度/高度并生成iframe代码

.container iframe {height: 250px;}


如果您想要响应视频,请尝试jQuery插件。

iframe是您需要更改的高度,而不是容器的高度。我尝试过编辑iframe,也尝试过如何编辑?显示更多的代码。
.container iframe {height: 250px;}
<?php
echo apply_filter('the_content', 'https://www.youtube.com/watch?v=6c7Fx2PR9Dk');
?>