<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS背景图片实现自适应、全屏、填充与拉伸的方法</title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(function(){
$('#formbackground').height($(window).height());
$('#formbackground').width($(window).width());
});
</script>
</head>
<body>
<div id="formbackground" style="position:absolute; width:100%; height:100%; z-index:-1">
<img src="http://v.bootstrapmb.com/2019/10/lm2of6197/images/bg-home.jpg" height="100%" width="100%"/>
</div>
</body>
</html>