Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何在任何地方限制img最大宽度?_Css_Vuetify.js - Fatal编程技术网

Css 如何在任何地方限制img最大宽度?

Css 如何在任何地方限制img最大宽度?,css,vuetify.js,Css,Vuetify.js,我正在用Vuejs构建一个应用程序,我在应用程序外部使用v-html标记包含html 所以基本上是 我遇到的问题是,有时包含的html中的太大。我想限制它的宽度 <style> .guardian img { width:50% !important; max-width:200px !important; } .gu-image { width:50% !important; max-width:200px !important; } </style>

我正在用Vuejs构建一个应用程序,我在应用程序外部使用
v-html
标记包含html

所以基本上是

我遇到的问题是,有时包含的
html
中的
太大。我想限制它的宽度

<style>
.guardian img {
  width:50% !important;
  max-width:200px !important; 
}
.gu-image {
  width:50% !important;
  max-width:200px !important; 
}
</style>

《卫报》杂志{
宽度:50%!重要;
最大宽度:200px!重要;
}
顾先生形象{
宽度:50%!重要;
最大宽度:200px!重要;
}

但它不起作用。我的问题是:如何控制页面上任何地方的img宽度?

img{max width:XXXpx}
一直不起作用您在哪里生成的html?在v-card内部-text@Traxo我确实使用了样式范围。。。它解决了问题!谢谢