Html Iframe不调整大小

Html Iframe不调整大小,html,css,iframe,media-queries,Html,Css,Iframe,Media Queries,所以我有这个iframe iframe { width: 39%; height: 447px; max-height: 447px; } 我希望它在小型设备上变得更小,所以我补充道 @media only screen and (max-width:500px) { iframe { height: 150px !important; max-height: 150px !important; } } 但它不起作用,原因是什么? 问候语, herrso

所以我有这个iframe

iframe {   
width: 39%;
height: 447px;
max-height: 447px;
}
我希望它在小型设备上变得更小,所以我补充道

@media only screen and (max-width:500px) { 
   iframe { 
   height: 150px !important; 
   max-height: 150px !important;
   } 
}
但它不起作用,原因是什么? 问候语, herrsocke

试试这个:

 @media screen and (max-width:500px) { 
       iframe { 

       max-height: 150px !important;
       } 
        }