code

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
<meta name="description" content="xxxxx"/>
<meta name="keywords" content=""/>
<meta content="caibaojian" name="author"/>
<title>xxxxxxxxxxx</title>
<link rel="stylesheet" href="base.css">
<style>
#header {
position: absolute;
left: 0;
right: 0;
top: 0;
z-index: 10;
}
#content {
position: absolute;
top: 10rem;
overflow: hidden;
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-color: #666;
background-size: cover;
opacity: 1;
background-image: url(a.png);
}

</style>
<script type="text/javascript">
(function(doc, win){
var docE1 = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function(){
var clientWidth = docE1.clientWidth;
if(!clientWidth) return;
alert(clientWidth);
docE1.style.fontSize = 20 * (clientWidth / 1440) + 'px';
};

if (!doc.addEventListener) return;
win.addEventListener(resizeEvt,recalc,false);
doc.addEventListener('DOMContentLoaded',recalc,false);
})(document,window);
</script>
</head>

<body>
<div style="min-height: 100%;height: auto !important;">
<div id="header" style="font-size:6rem;line-height:7rem;padding-top:1.5rem;padding-bottom:1.5rem; ">
<a href="/" style="">X hahahhh</a>
</div>
<div id="content" >
</div>
<!-- 正文 -->
<div id="foot"></div>
</div>
</body>
</html>

posted @ 2018-06-23 11:53  taylor.yan  阅读(202)  评论(2编辑  收藏  举报