Html 当浏览器宽度更改时,图像在ie8中不调整大小
在ie8中调整图像大小之前,我遵循以下提示: 不过,在我的网站上,我并没有幸做到这一点。我在这里写了一些简单的代码来去除任何复杂性,但我仍然一事无成。我必须错过一些简单的东西Html 当浏览器宽度更改时,图像在ie8中不调整大小,html,css,image,internet-explorer-8,Html,Css,Image,Internet Explorer 8,在ie8中调整图像大小之前,我遵循以下提示: 不过,在我的网站上,我并没有幸做到这一点。我在这里写了一些简单的代码来去除任何复杂性,但我仍然一事无成。我必须错过一些简单的东西 <html> <head> <style> .container img { max-width: 100%; height: auto; width: auto; /*for ie8*/ } .container {
<html>
<head>
<style>
.container img {
max-width: 100%;
height: auto;
width: auto; /*for ie8*/
}
.container {
width: 100%;
}
</style>
</head>
<body>
<div class="container">
<img src="image.jpg" />
</div>
</body>
</html>
.集装箱img{
最大宽度:100%;
高度:自动;
宽度:自动;/*适用于ie8*/
}
.容器{
宽度:100%;
}
这是您需要的唯一CSS:
.container img {
width: 100%;
}
.container {
width: 100%;
}
图像将随浏览器缩放。确保您有doctype:
应该足以测试上述示例是否正常工作。谢谢。不用担心,很高兴能帮上忙:)