如题所述
<html>
<head>
<style>
html,body{width:100%;height:100%;margin:auto 0px;padding:auto 0px;text-align:center;}
.imgBox, .imgBox img{width:100%;height:100%;}
</style>
</head>
<body>
<div class="imgBox">
<img src="1.jpg" />
</div>
</body>
</html>
<head>
<style>
html,body{width:100%;height:100%;margin:auto 0px;padding:auto 0px;text-align:center;}
.imgBox, .imgBox img{width:100%;height:100%;}
</style>
</head>
<body>
<div class="imgBox">
<img src="1.jpg" />
</div>
</body>
</html>
如上代码可以实现,把图片换一下就OK了,希望可以帮到你。
温馨提示:答案为网友推荐,仅供参考
第1个回答 推荐于2017-10-15
function fullScreen(){
$("#container").css({"width":window.screen.width,"height":window.screen.height});
}
$(window).resize(function(){
fullScreen();
});
fullScreen();本回答被提问者和网友采纳
$("#container").css({"width":window.screen.width,"height":window.screen.height});
}
$(window).resize(function(){
fullScreen();
});
fullScreen();本回答被提问者和网友采纳