效果如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-widthh, initial-scale=1.0">
<title>Document</title>
<style>
#login {
position: absolute;
}
</style>
</head>
<body>
<div id="login"><img src="img/login.jpg" />
</div>
<script>
function show() {
var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
//获取宽度
var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
//获取高度
var