Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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
Html 图像随窗口调整大小,但某些尺寸上会显示黑条?_Html_Css_Image - Fatal编程技术网

Html 图像随窗口调整大小,但某些尺寸上会显示黑条?

Html 图像随窗口调整大小,但某些尺寸上会显示黑条?,html,css,image,Html,Css,Image,我已经编写了一些代码,以使图像根据显示在其中的web浏览器的窗口大小调整大小: <p> <a href="www.link.com"> <img src="/images/image.png" style="max-height: 235px; max-width: 100%; height:

我已经编写了一些代码,以使图像根据显示在其中的web浏览器的窗口大小调整大小:

<p>
  <a href="www.link.com">
    <img src="/images/image.png" style="max-height: 235px; 
                                        max-width: 100%;
                                        height: auto;
                                        width: auto; /* ie8 */" />
  </a>
</p>
在某些分辨率下,它会以类似的方式显示,右侧有一个黑条:

我怎样才能去掉这个黑条?是什么导致了这个问题?我不能在Web开发者工具中针对它,它不存在于所有窗口大小中,也不是图像的一部分


谢谢。

我只是猜测,因为我还没有测试过它,但也许该条可以是背景色或右边框,所以您可以这样做来验证

<a href="www.link.com">
    <img src="/images/image.png" style="max-height: 235px; 
                                    max-width: 100%;
                                    height: auto;
                                    width: auto; /* ie8 */
                                    background-color: none;
                                    border: none;" />
</a>

为什么有两个最大宽度值?@JoseMagana谢谢,已删除。问题依然存在:你能为此创建一个浏览器吗?我认为这是一个浏览器的问题。让浏览器调整图像的大小有时可以做到这一点。e、 g.从1000x1000大小的图像将尺寸设置为150x150。不过我只是在猜测。