我有一个HTML页面,其中我有一个页面,里面有我的内容,里面有一个div 现在,当我设置最后一个div的图像。在图像下方显示空白区域,并使html页面处于滚动位置。我不想要空白区域,并希望根据设备的高度和宽度来适应页面。但我无法实现任何帮助将受到高度赞赏
这是我的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="user-scalable=no" id="viewport_meta" />
<script type="text/javascript">
var viewport_meta = document.getElementById('viewport_meta');
var w = screen.availWidth;
var h = screen.availHeight;
viewport_meta.setAttribute('content', 'width=' + w + ', height=' + h + ',user-scalable=no');
</script>
<script src="tizen-web-ui-fw/latest/js/jquery.js"></script>
<script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js" data-framework-viewport-scale="false"></script>
<script type="text/javascript" src="./js/main.js"></script>
<script type="text/javascript" src="./js/swipe.js"></script>
<script src="tizen-web-ui-fw/latest/js/jquery.min.js"></script>
<script type="text/javascript" src="./jquery.mobile-1.3.0.js"></script>
<link rel="stylesheet" type="text/css" href="./css/style.css" />
</head>
<body>
<div data-role="page" id="page1">
<div data-role="content" data-scroll="none">
<div id="fullpage"></div>
</div>
</div>
</body>
</html>
在div id整页上,我设置了背景图片:
body {
background-repeat: no-repeat;
margin: 0;
overflow: hidden;
}
div {
width: 1280px;
height: 720px;
}
#page1{
width: 1280px;
height: 720px;
}
#fullpage {
background-image: url(../images/lastslide_en_752.jpg);
background-repeat:no-repeat;
background-size:60% 60%;
}
答案 0 :(得分:0)
考虑添加
background-repeat:no-repeat; background-size:100% 100%;
#fullpage Class 中的