我建立一個負責任的網站,我發現,自動圖像使用帶有broswer窗口大小調整調整IMG最大寬度:100件%作品在Chrome,但不IE和Firefox當任何父級或上級具有的位置是:絕對的;自動圖像調整:在Chrome 100%的工程,但不是IE瀏覽器時,父div有位置:絕對
(有關此技術的信息,請參閱 http://webdesignerwall.com/tutorials/responsive-design-with-css3-media-queries )
以下代碼可用於演示或重現此問題。你也可以在http://sketchmotion.com/image-test2/看到這個。你會發現,調整瀏覽器窗口將調整在Chrome,但不是IE的圖像(我運行IE 11)。但是,如果刪除以下行:
.mydiv{
position: absolute;
}
您會發現它現在可以在Chrome和IE中使用。
這是沒有幫助的,因爲我用我的位置是:絕對的;在我的網站上的一些父母div。我需要我的網站在IE和Firefox上工作。
請讓我知道是否有這個問題的解決辦法,所以我可以將圖像與我的網站上的瀏覽器窗口大小調整。
<html>
<head>
<!-- <link href="/cssh/ImageTest.css" rel="stylesheet" type="text/css"></link> -->
<style type="text/css">
.mydiv{
position: absolute;
}
img{
/*** Scaling Images with the Browser Window in CSS is pretty simple to implement for both images and video. ***/
/*** You can set the media element’s max-width to 100 percent, and the browser will make ***/
/*** the image shrink and expand depending on its container. ***/
/*** To maintain the right proportions use auto height ***/
max-width: 100%;
height: auto;
width: auto\9; /* ie8 */
}
</style>
</head>
<body>
<!-- -->
<div class="mydiv">
<div class="slides">
<div class="slide">
<img alt="" src="http://sketchmotion.com/ImagesSM/SM_Slider_1_SketchMotion_w_Sketch.jpg" />
</div>
</div>
</div>
</body>
</html>
@ user3101077特里·克蘭西 - 如果這個答案解決您的問題,或者是有幫助的,請接受這個答案,或者投了它吧。謝謝。 – MElliott